❔ Best Approach to deal with DDD Entities and EF Core Entities
Lets say I want towork on a project using
DDD
DDD
(Domain Driven Design) and
EF Core
EF Core
, as you know by following one of the DDD rules, the project should contains a
Domain
Domain
layer which contains the domain
Entities
Entities
... ,
Lets say in the
Domain
Domain
layer I have these entities :
public class Product : Entity{ public string Title { get; set; } public decimal Price { get; set; } // Constructoor and other behaviours}
public class Product : Entity{ public string Title { get; set; } public decimal Price { get; set; } // Constructoor and other behaviours}
public class Order : Entity{ public int ProductId { get; set; } public byte Quantitiy { get; set } public Decimal Total { get; set; } public Product Product {get; set; } // Constructoor and other behaviours}
public class Order : Entity{ public int ProductId { get; set; } public byte Quantitiy { get; set } public Decimal Total { get; set; } public Product Product {get; set; } // Constructoor and other behaviours}
From your experience, what is the best approach or implementation to let the two DDD's Entities and EF Core's Entities meet?