I am still in the process of knowing all the ins and outs of the organization framework, and at present I find it useful To use ExecuteSqlCommand of the framework, on some big updates, as it is quite fast while processing too many updates (especially when I only need to update one field). My question is two times: First, is it a safe way to handle my updates? For my information, the standard way to update via EF will be like
(user! = Null) {_Context.Entry (user) .CurrentValues.SetValues (updatedUser); _Context.SaveChanges (); }
or
{_Context.Entry (Update User) .set = EntityState.Modified; _Context.SaveChanges (); }
But both of these methods will be bugged down if the number of users is up to ~ 5000 to update, am I missing something, or am I accepting executivescale commodity ?
Secondly, if ExecuteSqlCommand is safe to rely on, then I can capture any such reference whose only purpose is to work it out, to make it every time I need it? My understanding is that in general, references should never be maintained because they slow down over time with usage, but I am wondering if this is right for such a limited use scenario. .
If my fundamental approach to using EF is in error, then I appreciate anyone paying attention to it. Thanks!
No comments:
Post a Comment