c# Convert LINQ var result to actual type
- by DrBob
In c#, Given the following code:
public class Person
{
public int PersonID { get; set; }
public int Age { get; set; }
public string Name { get; set; }
}
and
List<Person> people = new List<Person>();
for (int i = 0; i != 15; i++)
{
Person p = new Person();
p.PersonID = i;
p.Age = i *…