public void TableValuedFunctionTest() { using (AdventureWorks adventureWorks = new AdventureWorks()) { IQueryable<ContactInformation> employees = adventureWorks.ufnGetContactInformation(1).Take(2); Assert.IsNotNull(employees.Single()); } }
public void ComposedTableValuedFunction() { using (AdventureWorks database = new AdventureWorks()) { var employeesWithContactInformation = from employee in database.People from contactInfo in database.ufnGetContactInformation(employee.BusinessEntityID) select new { employee.FirstName, contactInfo.JobTitle } ; var employeeWithContactInformation = employeesWithContactInformation.Take(1).ToList(); Assert.AreEqual(employeeWithContactInformation.Count, 1); } }