public void Verify_TVFs_returning_entities_work() { using(var context = new NorthwindEntities()) { var inTransitOrders = context.fx_OrdersForShippingStatus(ShippingStatus.InTransit); // because TVFs are composable, we can query over the TVF results on the server instead of in memory. var orders = inTransitOrders.Where(o => o.ShipCountry == "Poland").ToList(); Assert.Equal(3, orders.Count); Assert.Contains(10611, orders.Select(o => o.OrderID)); Assert.Contains(10870, orders.Select(o => o.OrderID)); Assert.Contains(10998, orders.Select(o => o.OrderID)); } }