| linq/data.cs - Sample data - Class Persons and a collection of persons. | Lecture 16 - slide 4 : 11 Program 1 |
using System;
using System.Collections.Generic;
public enum Sex {Female, Male}
public class Person{
public string FName{get; set;}
public string LName{get; set;}
public int Age{get; set;}
public Sex Sex{get; set;}
public override string ToString(){
return FName + " " + LName;
}
public static List<Person> SomePersons{
get {
return
new List<Person>{
new Person{FName="Pippi", LName="Pi", Age=25, Sex = Sex.Female},
new Person{FName="Lone", LName="Rho", Age=51, Sex = Sex.Female},
new Person{FName="Anni", LName="Lyng", Age=36, Sex = Sex.Female},
new Person{FName="Martin",LName="Beck", Age=57, Sex = Sex.Male},
new Person{FName="Per", LName="Birk", Age=47, Sex = Sex.Male},
new Person{FName="Stig", LName="Malm", Age=50, Sex = Sex.Male}
};
}}
}