I am using Entity Framework 6 and database-first to generate my table entities. Is it possible to make the entities private?
This is my project setup:
- Project.Core
DatabaseFirstContext.edmx
Service.cs
DomainModel.cs
Repository.cs
- Project.Web
HomeController.cs
I would like my Project.Web
to be able to see my DomainModel.cs
but not the entities which the DatabaseFirstContext.edmx
generates. The reason I would like to keep the EF6 generated entities in the Project.Core
is because it is one less layer of mappings. This way the Service.cs
can work directly with the generated entities. But I would like to prevent the Project.Core
from exposing the generated entities to other projects and prevent other developers from exposing them.