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

  • Home
  • SEARCH
  • 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 9164967
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T14:48:26+00:00 2026-06-17T14:48:26+00:00

I recently added 7 views to a database. When I go to may project

  • 0

I recently added 7 views to a database. When I go to may project that contains the data models for that db and use Reverse Engineer Code First (in EF 4.3.1) several views are not generated.

At first I thought there was some sort of order issue where a few of the views which depended on other views were somehow out of order and might be impacting the process. I renamed my views so that in the SQL Server Management Studio they appeared alphabetically in order they are needed.

This did not seem to help.

The 5 views which are generated are indeed the first 5 views that need to be there. However, the final 2 views are the ones not being generated.

All the views except for the first 3 contain joins on other views so I don’t expect joins to be an issue.

However, it looks as though both the missing views contain aggregates (SUM and appropriate GROUP BY functions) whereas the first 5 don’t.

I’ve done some searches but I don’t see anywhere that there is a restriction on aggregate functions in regards to Reverse Engineer Code First. Is there a workaround to this issue?

Update:

I made a new project and, instead of using my own convoluted existing database, I tried using Adventureworks. When I reverse engineered it the view with aggregates did indeed get modeled properly by EF.

When I looked at this view (Sales.vSalesPersonSalesByFiscalYears) I noticed that the all the aggregates were done using pivot. So I then rewrote my views that use aggregates to use pivots instead. They still do not get imported.

  • 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-17T14:48:28+00:00Added an answer on June 17, 2026 at 2:48 pm

    There is some strange key detection logic in the reverse engineer code that I don’t fully understand. It could simply be that an entity key could not be detected for those views.

    In a separate project, try reverse engineering using database-first. The reverse engineer logic is the same, and it might give you more insight into why the views couldn’t be mapped.

    If all else fails, you can always manually create Code First classes that map to those views. The msdn.com/data/ef site has some good articles on Code First’s default conventions, as well as the data annotations and fluent APIs (for properties and types or relationships) that can be used to map POCO classes to a database.

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

Sidebar

Related Questions

I recently added a stored procedure to my SQL Azure database. I added that
I recently added the file Serial.c and Serial.h to my Xcode project. The code
I recently added a new project to my Visual Studio 2008 solution. Now, as
I recently added some namespaces to my web.config file so that all of my
I've recently added Microsoft Unity to my MVC3 project and now I'm getting this
For people who use Codaset... I can't push! :( My application is recently added,
I have recently converted my project to use ARC (Automatic Reference Counting). It doesn't
I started a Rails project recently and decided to use RESTful controllers. I created
I recently added an extra authentication backend to allow users to login using either
I recently added Autofac 2.6.2 to one of my ASP.NET MVC projet. I'm facing

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.