Views are not imported into Entity Framework

I have multiple views in my database that I am using in my ASP MVC application. Now I am experiencing a very strange problem. There are 8 views in the database, but even if I check them all in the Enthusiasm Generation Data Model tutorial, only 7 of them are available as objects in the datacontext.

If I try to import ONLY a view that is left out of the way, I end up with an empty model.

Are there any limitations that I am not aware of? Or is this a known issue?

+2


a source to share


3 answers


It looks like there is something special about this performance. Things to check:



  • Are the rights the same in this view as others?
  • Try making a selection in this view from the Query Manager to confirm that it works.
  • Open the "empty" model in xml view and see if it has any error messages
+1


a source


I am having trouble importing tables and views without specifying a key. The entity framework will try to assign it automatically if possible, but if you have duplicate data, you may need to create a primary key before EF injects it.



+1


a source


This is not a trick. I removed all connections from the view definition and added a very simple view (basically just a selection from one table). It worked. Then I added the joins one by one and made the view more difficult for each step. Now I have the same point of view as I did before I started this process and now I can import it with no problem. Something is strange in Denmark

0


a source







All Articles