Hi! I have entity in model, this enity is mapped to the view. Is there exist some way to turn off CUD opertions for the entity. I mean - when model is updated via save() and there is some modifyed items of such entity, they won't update.
Thanks!
Turn Off update for views
If you want the changes not to be sent to the database, don't change objects in your code. If objects are changed for some reason, you can turn off change tracking explicitly:baio wrote:Is there exist some way to turn off CUD opertions for the entity.
Code: Select all
Entities ctx = new Entities();
var query = ctx.Categories.Where(c => c.CategoryName.StartsWith("..."));
(query as ObjectQuery).MergeOption = MergeOption.NoTracking;
var result = query.ToList();