Home
Browse all 647 examples
Download all 647 examples
Download sample chapters
Reviews
Errata
Acknowledgments
Links on .NET
Paradoxal Press

Buy directly from Paradoxal Press at $33.99 (Save 43%)



Category: Programming
Level: Beginner to seasoned
900 pages
ISBN-10 097661322-0
ISBN-13 978-097661322-0
$59.99 USA
$79.99 CANADA


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 {
      getreturn m_EmployeeID; set{ m_EmployeeID=value; }
   }
   
public string SurName {   
      getreturn m_SurName; }    set{ m_SurName = value; } 
   }
   public string FirstName{ 
      getreturn 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