This snippet shows you how to use compiled queries with Entity Framework.
public void CompiledEF()
{
var compileqry=CompiledQuery.Compile<OMSEntities, IQueryable<Customer>>(
ctx =>
from cust in ctx.Customers
where cust.ContactTitle == "Manager"
select cust);
}