Edition 0 Updated to asp. Net core 0


Owned entities limitations



Yüklə 11,82 Mb.
Pdf görüntüsü
səhifə190/288
tarix12.07.2023
ölçüsü11,82 Mb.
#136458
1   ...   186   187   188   189   190   191   192   193   ...   288
Owned entities limitations 

You can’t create a 
DbSet
of an owned type (by design). 

You can’t call 
ModelBuilder.Entity()
on owned types (currently by design). 

No support for optional (that is, nullable) owned types that are mapped with the owner in the 
same table (that is, using table splitting). This is because mapping is done for each property, 
there is no separate sentinel for the null complex value as a whole. 


221 
CHAPTER 6 | Tackle Business Complexity in a Microservice with DDD and CQRS Patterns 

No inheritance-mapping support for owned types, but you should be able to map two leaf types 
of the same inheritance hierarchies as different owned types. EF Core will not reason about the 
fact that they are part of the same hierarchy. 
Main differences with EF6’s complex types
 

Table splitting is optional, that is, they can optionally be mapped to a separate table and still be 
owned types. 
Additional resources 

Martin Fowler. ValueObject pattern
https://martinfowler.com/bliki/ValueObject.html
 

Eric Evans. Domain-Driven Design: Tackling Complexity in the Heart of Software.
(Book; 
includes a discussion of value objects) 
https://www.amazon.com/Domain-Driven-Design-Tackling-Complexity-
Software/dp/0321125215/
 

Vaughn Vernon. Implementing Domain-Driven Design.
(Book; includes a discussion of value 
objects) 
https://www.amazon.com/Implementing-Domain-Driven-Design-Vaughn-
Vernon/dp/0321834577/
 

Owned Entity Types
https://learn.microsoft.com/ef/core/modeling/owned-entities
 

Shadow Properties
https://learn.microsoft.com/ef/core/modeling/shadow-properties
 


Yüklə 11,82 Mb.

Dostları ilə paylaş:
1   ...   186   187   188   189   190   191   192   193   ...   288




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©azkurs.org 2024
rəhbərliyinə müraciət

gir | qeydiyyatdan keç
    Ana səhifə


yükləyin