|
Listing 23-62 extracted from chapter ASP.NET 2
Listing 23-61< > Listing 23-63
This listing can be compiled with the command line: csc.exe /target:library Example_23_62.cs Errors: 0 Warnings: 0
Example_23_62.cs
using System.Collections;
using System.Collections.Generic;
public class Employee {
private int m_EmployeeID = -1;
private string m_SurName;
private string m_FirstName;
public int EmployeeID {
get{ return m_EmployeeID; } set{ m_EmployeeID=value; }
}
public string SurName {
get{ return m_SurName; } set{ m_SurName = value; }
}
public string FirstName{
get{ return m_FirstName; } set{ m_FirstName = value; }
}
}
public class Helper {
private static List<Employee> list = new List<Employee>();
static Helper() {
Employee emp = new Employee();
emp.EmployeeID = 1;
emp.SurName = "Doo";
emp.FirstName = "John";
list.Add(emp);
emp = new Employee();
emp.EmployeeID = 2;
emp.SurName = "Dupont";
emp.FirstName = "Anne";
list.Add(emp);
}
static public ICollection GetData() { return list; }
}
Copyright Patrick Smacchia 2006 2007
|