This is because you cannot define a database view using a code-based approach. A database view is a database design that uses SQL Query on top of existing tables / functions. You cannot define such constructs using the first code.
If you want to view, you must create it manually by running a CREATE VIEW SQL script, for example, in a custom initializer - this will be similar to this answer . Just keep in mind that this will not help you if you want to map an object to a view. In this case, you probably have to drop the table created by EF first and create a view with the same name (I have not tried, but could do the trick). Also keep in mind that not every view is udpatable, so you are likely to get only a read-only object.
Ladislav Mrnka May 04 '11 at 21:25 2011-05-04 21:25
source share