[英]How to create single table for owned types
請告訴我如何為擁有的類型生成單個數據庫表。 這是我的模特
public class Price
{
public string OrderId { get; set; }
public Money Money { get; set; }
public Error Error { get; set; }
public PriceType PriceType { get; set; } // enum
[ConcurrencyCheck]
public DateTimeOffset UpdatedOn { get; set; }
}
public class Money
{
public string Currency { get; set; }
public decimal Amount { get; set; }
}
public class Error
{
public ErrorType Type { get; set; }
public string Message { get; set; }
}
對Money和Error類使用[ComplexType]屬性https://entityframework.net/complex-type
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.