views:

38

answers:

1

I have an Entity Framework project, and it imports a read-only view as one of the entities. This view is related to other entities, and when I attempt to update those entities, it tries to update the view also. I get the error:

Unable to update the EntitySet 'vw_Consumer' because it has a DefiningQuery and no element exists in the element to support the current operation

How can I tell the entity framework to not to try to update that entity?

Thanks.

A: 

Hi, You could always implement insert & update stored procedure for the table that corresponds to the read only view and then configure EF to use the stored procedures. Then you simply perform no action in the stored procedures.

Here is an example of using stored procedures with EF.

Leigh Shayler
Yea, that is what I did, I was curious if there was a better way.
Sako73