Create SQL View With Entity Framework 6 Code First

c# ef-code-first entity-framework sql-server

Question

I'm trying to do a task that I believed to be straightforward while using Entity Framework 6 Code First for the first time. In my database environment, I want to first establish a SQL View and then have an Entity I can use to query the view.

Although I have experimented with articles like this, the main distinction in my situation is that the SQL View does not come from an already-existing database.

I looked into the idea put out in this piece, but it seems like overkill to me that I would need to write some extension methods in order to perform something as basic as creating a view/entity combo and using it in my database context.

Do I have something missing? I'm aware that it would be much simpler if I weren't using Code First, but remember that I'm trying to design a view rather than reuse one from an existing database.

1
4
5/23/2017 12:22:53 PM

Popular Answer

ZZZ_tmp
7
5/23/2017 12:15:02 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow