开发者

Entity Framework 4 - update/insert views

开发者 https://www.devze.com 2023-02-23 22:34 出处:网络
My EF schema has a mixture of tables and views from my database. My view entities开发者_C百科 are all read-only, I want to be able to update/insert into these entities. I\'ve tried the following post

My EF schema has a mixture of tables and views from my database. My view entities开发者_C百科 are all read-only, I want to be able to update/insert into these entities. I've tried the following post without any luck:

http://smehrozalam.wordpress.com/2009/08/12/entity-framework-creating-a-model-using-views-instead-of-tables/

Anyone have another ideas/pointers - this must be doable.

cheers David


Generally the post is correct. Using views in EF is hard. Another trick is first using tables to define your model and then replace tables in database with views with same names as tables.


Have you tried Instead of Triggers?

http://www.codeproject.com/Articles/236425/How-to-insert-data-using-SQL-Views-created-using-m

0

精彩评论

暂无评论...
验证码 换一张
取 消