1
我有2個簡單的類:的EntityFramework在單表繼承IsDiscriminator問題
public abstract class Device
{
public int DeviceID { get; set; }
public string SerialNumber { get; set; }
[Column(IsDiscriminator = true)]
public int DeviceTypeID { get; set; }
}
public class SomeDevice : Device
{
public string SomeAdditionalInfo { get; set; }
}
所有存儲在一個表:
的DeviceID | SerialNumber | DeviceTypeID | SomeAdditionalInfo
但在應用我有一個異常而檢索數據:
Invalid column name 'Discriminator'.
如果我改變列DeviceTypeID來鑑別比一切工作正常。爲什麼屬性IsDiscriminator = true會被忽略?
非常感謝! – urfin