using System.Collections.Generic;
public int Id { get; init; }
public string Name { get; init; }
public static void Main(string[] args)
var people = new List <Person>()
new Person() { Id = 1, Name = "Alex" },
new Person() { Id = 2, Name = "Franco" },
new Person() { Id = 3, Name = "Gabriel" },
new Person() { Id = 4, Name = "José" },
var peopleById = people.ToDictionary(
System.Console.WriteLine(peopleById[4].Name);