252
CHAPTER 6 | Tackle Business Complexity in a Microservice with DDD and CQRS Patterns
//Address value object persisted as owned entity type supported since EF Core 2.0
orderConfiguration
.
OwnsOne
(o => o.
Address
, a =>
{
a.
WithOwner
();
});
orderConfiguration
.
Property
<
int
?>(
"_buyerId"
)
.
UsePropertyAccessMode
(PropertyAccessMode.
Field
)
.
HasColumnName
(
"BuyerId"
)
.
IsRequired
(
false
);
orderConfiguration
.
Property
(
"_orderDate"
)
.
UsePropertyAccessMode
(PropertyAccessMode.
Field
)
.
HasColumnName
(
"OrderDate"
)
.
IsRequired
();
orderConfiguration
.
Property
<
int
>(
"_orderStatusId"
)
.
UsePropertyAccessMode
(PropertyAccessMode.
Field
)
.
HasColumnName
(
"OrderStatusId"
)
.
IsRequired
();
orderConfiguration
.
Property
<
int
?>(
"_paymentMethodId"
)
.
UsePropertyAccessMode
(PropertyAccessMode.
Field
)
.
HasColumnName
(
"PaymentMethodId"
)
.
IsRequired
(
Dostları ilə paylaş: