Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7037513
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:33:16+00:00 2026-05-28T01:33:16+00:00

For Compiled Queries, In LINQ to Object Entity FrameWork basically it allows the queries

  • 0

For Compiled Queries, In LINQ to Object Entity FrameWork basically it allows the queries to compile at one time and then it can be re-used without compiling another time.

For Example:

using System.Data.Objects;
public static Func<entity, string, IQueryable<Entity>>
    TestQuery = CompiledQuery.Compile((entity db, string param) =>
        from e in ctx.Entities where e.Field == param select e);

My question is for LINQ to Devart Entity FrameWork , unable to pass the entity . cos it allows only datacontext as a valid parameter.

Please suggest me how to convert the linq to devart entity framework(edml) for Compiled Queries.

NOTE: it working fine in “Devart LinqConnect Model(lqml)”
For example :

 public static Func<MyContext.dataContext , long,
             IQueryable<EMyContext.dataContext.tableName>>
           shopByCountry = CompiledQuery.Compile((MyContext.dataContext db,     long idCountry) =>
             from a in db.Countries where a.idCountry == idCountryselect a);

but not in “Devart Entity Model” since edml is “ObjectContext” , lqml is “DataContext”

Thanks in Advance,

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T01:33:16+00:00Added an answer on May 28, 2026 at 1:33 am

    CompiledQuery ( http://msdn.microsoft.com/en-us/library/bb896297.aspx ) in Entity Framework is supported only for ObjectContext. There is no such support for DbContext (EF v4.1/EF v4.2): http://blogs.msdn.com/b/adonet/archive/2011/03/02/ef-4-1-is-coming-dbcontext-api-amp-code-first-rtw.aspx . Probably, you are working with DbContext.

    In case of Entity Framework June 2011 CTP, it is possible to avoid an explicit compilation because auto-compiled LINQ queries are implemented in EF June 2011 CTP: http://blogs.msdn.com/b/efdesign/archive/2011/06/30/auto-compiled-linq-queries-entity-framework-june-2011-ctp.aspx .

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to pre-compile queries in my Entity Framework application using my entities object.
When using compiled queries in entity framework (or linq-to-sql) in combination with SQL Server,
I have been using LINQ with compiled queries, basically passing into the compiled query
I'm attempting to refactor a cumbersome LINQ-to-SQL data layer with an entity framework one.
Which ORM will give me compile-tested queries? Is linqtosql compile time tested? Edit: Say
Pre-compiled headers seem like they can save a lot of time in large projects,
I started using compiled queries to increase the performance of some commonly executed linq
I see a lot of posts of people using compiled Linq to Sql queries
I am encountering some performance problems with my Entity Framework Code-First queries and I
I am trying to chain multiple compiled linq queries together. I have succeeded in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.