Ejemplo n.º 1
0
        [TableView(true)] //Table view == List View
        public static IQueryable <Customer> FindIndividualCustomerByName([Optionally] string firstName, string lastName, IFunctionalContainer container)
        {
            IQueryable <Person> matchingPersons = PersonRepository.QueryContactByName(firstName, lastName, container);

            return(from c in container.Instances <Customer>()
                   from p in matchingPersons
                   where c.PersonID == p.BusinessEntityID
                   select c);
        }
Ejemplo n.º 2
0
        public static IQueryable <SalesPerson> FindSalesPersonByName([Optionally] string firstName, string lastName, IFunctionalContainer container)
        {
            IQueryable <Person> matchingPersons = PersonRepository.QueryContactByName(firstName, lastName, container);

            return(from sp in container.Instances <SalesPerson>()
                   from person in matchingPersons
                   where sp.BusinessEntityID == person.BusinessEntityID
                   orderby sp.EmployeeDetails.PersonDetails.LastName, sp.EmployeeDetails.PersonDetails.FirstName
                   select sp);
        }
Ejemplo n.º 3
0
        internal static IQueryable <Employee> QueryEmployeesByName(
            string firstName,
            string lastName,
            IFunctionalContainer container)
        {
            IQueryable <Person> matchingContacts = PersonRepository.QueryContactByName(firstName, lastName, container);

            return(from emp in container.Instances <Employee>()
                   from contact in matchingContacts
                   where emp.PersonDetails.BusinessEntityID == contact.BusinessEntityID
                   orderby emp.PersonDetails.LastName
                   select emp);
        }