projections (objects mapped from a query) are not updatable.
only DbSets defined in the DbContext that are mapped to a table (or updatable view) support updates.
note: sql databases do not support updating multiple tables in a single statement.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello,
I want to update three table with one Query in Entity Framework:
Customer_Identification Region Customer Account
| Id |Region_Id |Customer Id
| Name |Region_Name |Bank_Name
| Address |Bank Account
| Region_Id
I created a class Customer with all fields required and I used a join query to select what information I want to
update in database.
I try to update changes in this way :
dataContext.Entry( Customer).State = System.Data.Entity.EntityState.Modified;
dataContext.SaveChanges();
I receive the following exception :
The entity type DbQuery`1 is not part of the model for the current context.
How is possible to update database without using multiple queries?
Best regards,
projections (objects mapped from a query) are not updatable.
only DbSets defined in the DbContext that are mapped to a table (or updatable view) support updates.
note: sql databases do not support updating multiple tables in a single statement.