Search code examples
entity-frameworkentity-framework-4entity-sql

ESQL in Entity Framework


Is there any good and, if possible, exhaustive documentation about ESQL in entity framework ?

I'm trying to make a select of an entity object with modification of a property using a method; something like this :

SELECT foo FROM context.foo WHERE foo.Price = AddTaxes(foo.Price)

Solution

  • There is msdn providing some documentation Entity SQL Language

    You can also combine it with Linq2Entities with something like

    context.foo
        .Where("it.Price == @Price", new ObjectParameter[] 
        { new ObjectParameter("Price", AddTaxes(price) } ).ToList()