Domain Model Net Core
Your domain model will be composed simply of your code.
Domain model net core. In the asp net core application the model could mean many things depending on the what are you trying to do. Although these are kind of basic concepts for people who are into asp net mvc for some time or mvc pattern in general but can be really confusing for new comers. Your goal is to create a single cohesive domain model for each business microservice or bounded context bc.
Data models vs domain models the first thing to keep in mind with this approach is don t make your domain model a different class to your data model. Difference between domain model viewmodel and editmodel in asp net mvc we often hear terms like model view model etc in context of mvc applications. Define one rich domain model for each business microservice or bounded context.
For this blog we re going with entity framework core the flagship net orm which was rewritten to be used with net core. In the previous section the fundamental design principles and patterns for designing a domain model were explained. It will have.
Ef core is an object relational mapping orm framework that simplifies the data access code that you have to write. The asp net core web api that represents the application layer must not contain business rules or domain knowledge especially domain rules for transactions or updates. These should be owned by the domain model class library.
Implementing a microservice domain model with net core. The application layer must only coordinate tasks and must not hold or define any domain state domain model. Now it is time to explore possible ways to implement the domain model by using net plain c code and ef core.
By rick anderson and tom dykstra. We will learn what they are and how and where to use them. Keep in mind however that a bc or business microservice could sometimes be composed of several physical services that share a single domain model.