© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
14 replies
M B V R K

❔ 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?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ EF Core not getting all entities
C#CC# / help
3y ago
✅ Best practice with EF Core "constants"?
C#CC# / help
3y ago
❔ Using automapper to update EF Core entities recursively
C#CC# / help
3y ago
Database Design with EF Core: Two Entities share another Entity
C#CC# / help
2y ago