示例#1
0
        protected static IEnumerable<Employee> InitEmployeesWithData()
        {
            var countryNL = new Country { Id = 1, Code = "NL", Name = "The Netherlands" };
            var countryBE = new Country { Id = 2, Code = "BE", Name = "Belgium" };

            var mainCompany1 = new MainCompany { Id = 1, Name = "m-1" };
            var mainCompany2 = new MainCompany { Id = 2, Name = "m-2" };

            var companyA = new Company { Id = 1, Name = "A", MainCompany = mainCompany1 };
            var companyB = new Company { Id = 2, Name = "B", MainCompany = mainCompany1 };
            var companyC = new Company { Id = 3, Name = "C", MainCompany = mainCompany2 };

            return InitEmployees(countryNL, countryBE, companyA, companyB, companyC);
        }
        private static IEnumerable<Employee> InitEmployees()
        {
            var mainCompany1 = new MainCompany { Id = 1, Name = "m-1" };
            var mainCompany2 = new MainCompany { Id = 2, Name = "m-2" };

            var companyA = new Company { Id = 1, Name = "A", MainCompany = mainCompany1 };
            var companyB = new Company { Id = 2, Name = "B", MainCompany = mainCompany1 };
            var companyC = new Company { Id = 3, Name = "C", MainCompany = mainCompany2 };

            return new List<Employee>
            {
                new Employee { Id = 1, Company = companyA, FirstName = "Bill", LastName = "Smith", Email = "*****@*****.**", EmployeeNumber = 1001, HireDate = Convert.ToDateTime("01/12/1990")},
                new Employee { Id = 2, Company = companyB, FirstName = "Jack", LastName = "Smith", Email = "*****@*****.**", EmployeeNumber = 1002, HireDate = Convert.ToDateTime("12/12/1997")},
                new Employee { Id = 3, Company = companyC, FirstName = "Mary", LastName = "Gates", Email = "*****@*****.**", EmployeeNumber = 1003, HireDate = Convert.ToDateTime("03/03/2000")},
                new Employee { Id = 4, Company = companyA, FirstName = "John", LastName = "Doe", Email = "*****@*****.**", EmployeeNumber = 1004, HireDate = Convert.ToDateTime("11/11/2011")},
                new Employee { Id = 5, Company = companyB, FirstName = "Chris", LastName = "Cross", Email = "*****@*****.**", EmployeeNumber = 1005, HireDate = Convert.ToDateTime("05/05/1995")},
                new Employee { Id = 6, Company = companyC, FirstName = "Niki", LastName = "Myers", Email = "*****@*****.**", EmployeeNumber = 1006, HireDate = Convert.ToDateTime("05/05/1995")},
                new Employee { Id = 7, Company = companyA, FirstName = "Joseph", LastName = "Hall", Email = "*****@*****.**", EmployeeNumber = 1007, HireDate = Convert.ToDateTime("05/05/1995")},
                new Employee { Id = 8, Company = companyB, FirstName = "Daniel", LastName = "Wells", Email = "*****@*****.**", EmployeeNumber = 1008, HireDate = Convert.ToDateTime("05/05/1995")},
                new Employee { Id = 9, Company = companyC, FirstName = "Robert", LastName = "Lawrence", Email = "*****@*****.**", EmployeeNumber = 1009, HireDate = Convert.ToDateTime("05/05/1995")},
                new Employee { Id = 10, Company = companyA, FirstName = "Reginald", LastName = "Quinn", Email = "*****@*****.**", EmployeeNumber = 1010, HireDate = Convert.ToDateTime("05/05/1995")},
                new Employee { Id = 11, Company = companyB, FirstName = "Quinn", LastName = "Quick", Email = "*****@*****.**", EmployeeNumber = 1011, HireDate = Convert.ToDateTime("05/05/1995")},
            };
        }