c# - Should I use MergeOption.NoTracking when I want to retrieve data just for display? -
lets want display data on webpage, load data:
using (kentities ctx = new kentities()) { ctx.kset.mergeoption = mergeoption.notracking; var items = (from c in ctx.kset c.parentid == 0 select new { title = c.title, id = c.id, subs = ctx.kset.where(o => o.parentid == c.id) }).tolist(); }
is there benefit using mergeoption.notracking?
if now, when should use it?
yes, if want data, use mergeoption.notracking. means wont stored in graph keeps track of entity updating , deleting. helps performance alittle in terms of memory.
Comments
Post a Comment