For a long time I tried different approaches to this problem. In its simplicity with the Entity Framework, it is possible and very simple to use data classes as domain classes.
My experience is that in small projects you can get away with using your EF classes as domain classes. Itβs quick and easy, but as projects become larger, this start becomes a problem, because you cannot control access in any way.
The most common scenario is to expose navigation properties on EF classes. Now your application will be able to move around the entire data set. Thus, with this model, you give up control over your data and domain objects.
There are several advantages to using your domain classes separately from EF. First of all, you will not be so attached to EF or code. With the level of separation / indirection, you can change your data structure if you want. Secondly, you can manage your data more efficiently.
Personally, I reached a pragmatic moment when I make this decision at the beginning of each project. If the project is small and contained, I could avoid this additional abstraction in favor of simplicity. In almost always medium and / or large projects, I have a separation.
source share