EF Core - Generic repository update method
I have a generic repository which contains my general CRUD operations interacting with my DbContext.
I have an Update method which updates the Entity in the dbSet based on the new values. The TEntity is a class which has a property that depends on another custom class. When I call this function, all TEntity properties are updated except these navigation properties.
Is there a way to generically add
Include
and take an argument of properties to include?
For extra context, I was able to do something similar on my Get methods, but unsure how this really would applied to update:
1 Reply
yeah the easy way to do it is to delete your generic repository and just use ef