Example #1
0
        public static List <BusinessObjects.Employee> MapToBusinessLayer(this dsAdventureWorks2012.EmployeePersonDataTable employeeTable)
        {
            // Create new list to be returned
            var employeeList = new List <BusinessObjects.Employee>();

            // If the employee table is empty, return the empty list
            if (employeeTable == null || employeeTable.Rows.Count < 1)
            {
                return(employeeList);
            }

            // Otherwise, create a BO for each row in the table and add to the return list
            foreach (var row in employeeTable)
            {
                employeeList.Add(row.MapToBusinessLayer());
            }
            ;

            // Return the new list of BOs
            return(employeeList);
        }
Example #2
0
 public List <BusinessObjects.Employee> GetAllEmployees()
 {
     dsAdventureWorks2012.EmployeePersonDataTable employees = employeeAdapter.GetData();
     return(employees.MapToBusinessLayer());
 }