Browse by Tags

Tagged Content List
  • Blog Post: Web API [Queryable] current support and tentative roadmap

    The recent preview release of OData support in Web API is very exciting (see the new nuget package and codeplex project ). For the most part it is compatible with the previous [Queryable] support because it supports the same OData query options. That said there has been a little confusion about how ...
  • Blog Post: Tip 37 – How to do a Conditional Include

    Problem Someone asked how to do a Conditional Include a couple of days ago on StackOverflow. They wanted to query for some entity (lets say Movies) and eager load some related items (lets say Reviews) but only if the reviews match some criteria (i.e. Review.Stars == 5). Unfortunately though this isn...
  • Blog Post: Tip 35 – How to write OfTypeOnly<TEntity>()

    If you write a LINQ to Entities query like this: var results = from c in ctx.Vehicles.OfType<Car>() select c; It will bring back, Cars and any type that derives from Car, like say SportCar or SUV. If you just want Cars and you don’t want derived types like SportCars or SUVs in LINQ to...
  • Blog Post: Tip 31 – How to compose L2O and L2E queries

    Imagine you want to write a query like this: var possibleBuyers= from p in ctx.People where p.Address.City == “Sammamish” && InMarketForAHouse(p) select p; Now theoretically this is possible so long as there is a SQL translation for InMarketForAHouse. In EF 4.0 you do this by creating a CLR stub...
Page 1 of 1 (4 items)