即時尋找任何建議更好的方式來編寫以下在LINQ?更好的方式來編碼這個linq語句
var tblequipments = from d in db.tblEquipments.Include(t => t.User).Include(t => t.ChangeLog).AsEnumerable()
where ((d.Development != 1 || d.Development == null) &&
(d.Deleted != 1 || d.Deleted== null) &&
(d.Stock != 1 || d.Stock == null)) &&
(d.DecommissionDate == Convert.ToDateTime("1900-01-01") || d.DecommissionDate == null)
select d;
感謝
如果你在談論可讀性,那麼'd'和這些自定義'1'值是什麼意思? –
對不起,我錯過了代碼的開頭,只是有更好的方法來檢查nots和nulls(也許在一個語句中)或任何東西,或者這是一個很好的linq聲明? Thans – AlexW
它有什麼問題? – cadrell0