0
這裏是我的數據庫模型類的時候我要選擇刪除相關記錄我得到「值不能爲null.Parameter名:源」值不能爲空。參數名:源
[Table("EkranKullanicisiKisitlama")] public class EkranKullanicisiKisitlama : ISimpleEntity<long> { public long ID { get; set; } public string KurumVKn { get; set; } public string SaticiKurum { get; set; } public bool Flag { get; set; } }
`(child_set as DbSet<ISimpleEntity<long>>)`
child_set是實體並且它變滿當試圖嘗試投DbSet時它返回null
adr = (child_set as DbSet<ISimpleEntity<long>>).FirstOrDefault(p => p.ID == ID) as T;
可以添加錯誤的'堆棧trace'的
DbSet
? – Loetn 2014-09-04 14:26:07堆棧跟蹤是emtpy。我只能說當它投射到DbSet>它會返回null –
altandogan
2014-09-05 05:44:31