I have an entity model in my project that contains some SQL Views - the views where imported using the "Update model from database" option.
Now when I choose "generate database from model" I see those Views a开发者_如何学Cs Tables instead. How can I avoid this?
That is correct behavior. EF has no idea what was the SQL code defining the view and because of that it can't create it. Moreover EF doesn't care about the way you created your current model so if you first define your model from DB containing views and then create database from that model it will indeed replace all views by tables.
精彩评论