Entity configuration management with limited DDD context

I am trying to implement several limited DDD contexts as described here . This is an example context:

Sample context

I have an entity type configuration file for each object with corresponding FluentAPI mappings (with reverse processing using EF toolkit). These configuration files also include relationship configurations.

for example: UserMap.cs

// Relationships
this.HasOptional(t => t.SecurityProfile)
    .WithMany(t => t.Users)
    .HasForeignKey(t => t.SecurityProfileCode);

SecurityProfileand DomainPermissionare not DbSetsin context. They are automatically cast into the model due to the navigation properties on Userand, Modulerespectively.

This causes my first problem. When adding User(or any other object) to any other context, I must remember to do one of two things:

  • SecurityProfile ( )

  • SecurityProfile -.

.

"" , 2 .

Ignore() , .

modelBuilder.Ignore<SecurityProfile>(); OnModelCreating ConfigureAssociations():

System.InvalidOperationException: "SecurityProfile" "". , .

, , - . , 30-40 + , .

, .

?

+5
1

- :

, , , -, , DDD , DTO/POCO . DDD.

, , ( /) , ubiquitous language .

, , , . , , .

- ( DDD eXchange), , DDD, . , . ( -), .

0

All Articles