All pastes #609895 Raw Edit

Untitled

public text v1 · immutable
·published 2007-07-09 03:52 UTC
rendered paste body
        static void Main(string[] args)
        {
            //Create the programming department
            Console.WriteLine("Creating the programming department");

            Department d = new Department();
            d.Name = "Programming";
            Broker.Insert(d);
            
            Console.WriteLine("Saved");

            Console.Write("Creating employee Matthew in the programming department");
            Employee e = new Employee();
            e.FirstName = "Matthew";
            e.LastName = "Dunn";
            e.Email = "mrdunn@gmail.com";
            e.Department = d;
            
            Broker.Insert(e);
            
            Console.WriteLine("Saved");

            Console.WriteLine("Listing people in programming dept");
            IList employees = d.Employees;
            Console.WriteLine("Found {0} employees", employees.Count);         
            
            foreach (Employee employee in employees)
            {
                Console.WriteLine(employee.FirstName);
            }
        }