I am using EF 6 with WPF. Since I have to work with lots of DataSets, I have to use AsNoTracking()
with the queries. Thus, updating any of the entries is now a responsibility of the ViewModel. I am using repository pattern
, and I am thinking of implementing a method in the generic repository
like this:
virtual public void Update(T updatedentity)
{
_ctx.Set<T>().Attach(updatedentity);
_ctx.Entry(updatedentity).State = EntityState.Modified;
}
Is this a good idea? What are the pros and cons of this approach? And finally, will there be the significant performance hit? A point to note here, most of my entities have at most 15-20 attributes.