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 7086221
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:31:22+00:00 2026-05-28T07:31:22+00:00

I am changing my old ADO.Net ways for the Entity Framework. My Products class

  • 0

I am changing my old ADO.Net ways for the Entity Framework. My Products class is made up from about 20 tables (3 of which I have combined so far into the single class), there are 5 Product type tables also, so I have made the Product class Abstract and each type has its own class using the lovely inheritance that the Entity Framework provides using the Table per Type methodology as below. So effectively 3 tables on a product class and 5 product type tables, each with its own class derived from Product.

<there was a screenshot here, I don't have the rep to post it though!>

I have been keeping an eye on what this EDM is doing under the covers with the SQL Server Profiler as I’ve been working. When I run a simple Linq to Entities Query as below:

var model = from p in Product.Products
                    where p.archive == false && ((Prod_ID == 0) || (p.ID == Prod_ID))
                    select p;

Which brings back all types of products that are not archived, and may potentially have an ID search in there as well, the sql profiler shows me an 800 line piece of SQL!!

Is this normal? And is this performant? Or have I sent the Entity Framework crazy?

<I tried to post the SQL too, but there was too much of it for the post>

So please, just a sanity check and any advice!

Regards,

Mark

  • 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-28T07:31:22+00:00Added an answer on May 28, 2026 at 7:31 am

    The Entity Framework can kick out some very large queries, but generally the SQL Server query optimiser does its thing and the query executes with the server barely noticing.

    Beyond being generally sensible, sensible I personally tend not to worry about performance and optimisation until a performance analysis tells me I’ve got a bottleneck; if you’re already using SQL profiler, does the query take a relatively long time to execute? Have you had a look at the execution plan and does it look ok?

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

Sidebar

Related Questions

I am trying to get my old paging class to work which relied on
Does the entity framework 4.0 track changes on Plain old C# object? If so,
I have a bunch of old classic ASP pages, many of which show database
I have to maintain an old database which is not properly normalized. For instance
The UK VAT system is changing from 17.5% to 15%. What strategies have you
I have an old project from the 1990's I desperately need to compile. The
Why does changing the below code from the Old to New entry fix the
We are changing some of the text for our old, badly written error messages.
changing a static resource during runtine is something that sounds not possible. I have
Changing a Linux C++ program which gives the user limited file access. Thus the

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.