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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T23:31:48+00:00 2026-05-19T23:31:48+00:00

I have an edmx file that reflects 100% my DB schema. Along with this

  • 0

I have an edmx file that reflects 100% my DB schema.
Along with this I need to create some custom Entities based on the existent, pretty much like a view that will aggregate fields of several entites into a single one.

The problem is that this isn’t quite working. I tried several approaches but it always gave me conflicts with the actual entites already on the edmx.

I need to have those entities that reflect my DB schema, so do I have to create another edmx file to hold my custom entites and avoid colisions?

I also though of:

  • create a stored procedure but then if
    I need to filter the SP result I
    eather have to add support for serach
    on the SP of get all the rows and
    filter with Linq2Objects… won’t do
    this!
  • create a View, and this one would
    work pretty well but I want to try
    to do this making use of the EF4
    designer and keep everything in one
    place.

Could anyone point me to some examples?

  • 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-19T23:31:49+00:00Added an answer on May 19, 2026 at 11:31 pm

    You can’t define two entities based on same table except special cases (table splitting, hiearchy mapping). In this case you have to use DefiningQuery as @James suggested or QueryView. The difference is that DefiningQuery is defined in storage model and it is common SQL. QueryView is defined in conceptual model and it is ESQL defined on top of already existing entities. QueryView supports only some features of ESQL (for example it doesn’t support aggregate functions). In both cases you have to modify EDMX directly (XML), these features are not supported in designer.

    Database view mentioned by @James is also an option if you don’t want to use these advanced EF features. You can as well simply expose predefined queries on your object context and map return projection to custom type.

    Be aware that neither of these methods will allow you to modify, insert or delete data.

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

Sidebar

Related Questions

I have this EF database-first EDMX file that I created it with a local
I have an edmx file that I generated using edmgen2, I am using the
I have the following entities mapped in my edmx file which is a mirror
I'm creating a C# T4 template to scaffold some classes based on .edmx file,
I created some tables in an .edmx file and have been generating the database
Ok, so I'm not using Sql Client. I have an .edmx file in my
i have an entity-model file (edmx) file which contains few tables and few stored
I have mapped the database in the edmx file from the database. Now how
I have in my web application an ADO.NET Entity-Framework *.edmx file. When I browse
I have this edmx model (see below) and I would like to add an

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.