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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T00:10:47+00:00 2026-06-02T00:10:47+00:00

I am using EF4 and trying to add a SQL view into the model.

  • 0

I am using EF4 and trying to add a SQL view into the model.

The relationship between them is 1-1, one side is Order the other is OrderSummary (the summary is the view and contains aggregate data).

When I add the view it detects the key on the view (OrderID) but I have to manually create the 1-1 relationship.

The problem I am encountering though is that when I try and build the application I get the error:

No mapping specified for the following EntitySet/AssociationSet – OrderOrderSummary.

I’ve been hunting around and can’t find a solution to this particular problem when using a view, most of the errors seem to be around incorrectly configured database schema but so far as I can tell my view is ok:

CREATE VIEW [store].[OrderSummary]
AS
SELECT        store.Orders.OrderID, COUNT(*) AS LineCount
FROM          store.Orders INNER JOIN
              store.OrderLines ON store.Orders.OrderID = store.OrderLines.OrderID
GROUP BY store.Orders.OrderID, store.OrderLines.OrderLineID

Do I need to do anything more to my view for it to work in EF and in a 1:1 relationship?

  • 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-06-02T00:10:49+00:00Added an answer on June 2, 2026 at 12:10 am

    I solved this problem. It appears when I was creating the association I wasn’t specifying the referential constraint (by double clicking the line between the table/view).

    Took a little while but hopefully my pain can help someone else!

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

Sidebar

Related Questions

I'm using MVC3 & EF4, running into a bit of a problem when trying
I'm trying to make a one to many self reference using EF4.1 code first.
I am trying to teach my self MVC3 and EF4 using code first and
I am using EF4 to read data from a view .This is a summary
I am trying to create a generic method using EF4 to find the primary
i'm having issues trying to implement a forloop in a view using a ViewModel.
I am using VS2010 B2 and EF4 B2 and trying to use Rhino Mocks
I'm starting a new web project using ASP.NET Webforms + EF4. I'm trying to
I am trying to do some tests using EF4 + CTP5 with code first
I'm getting an issue while using EF4, when I'm trying to verify if object

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.