digipolisantwerp / dataaccess_aspnetcore_deprecated

Generic repository/unit of work framework for ASP.NET Core with Entity Framework.
Other
140 stars 45 forks source link

IEntityContext access level #29

Open prethishmathew opened 7 years ago

prethishmathew commented 7 years ago

Is there a reason why the IEntityContext access level is set tot internal? To customize any class that uses IEntityContext, would take changing all the classes that use IEntityContext.

StevenVandenBroeck commented 7 years ago

Hi, can you describe exactly what you would like to do with the IEntityContext ? The whole idea of our repository library is to hide the context from other (business) code so it can't be addressed outside the data layer.

bojbaj commented 7 years ago

hi i need to do some changes like this : [context].Entry(model).Property(x => x.UnModified).IsModified = false; so i need to access the context.

StevenVandenBroeck commented 7 years ago

Hi bojbaj,

you can do that in a custom repository by inheriting it from RepositoryBase. The repositories have full access to the context. This keeps data access related code separate from other (business) code.