簡體   English   中英

如何為擁有的類型創建單個表

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM