我正在开发 MVC 应用程序。
我正在尝试在控制器中编写 LINQ 语句,但它给出了错误...
ViewBag.CompanyIdList = new SelectList(db.Companies.OrderBy(t => t.Name).Where(t=>t.IsDeleted!=true || t=>t.IsTransfer !=true) , "Id", "Name");
什么问题?
问题已解决,感谢神秘人
ViewBag.CompanyIdList = new SelectList(db.Companies.OrderBy(t => t.Name).Where(t => (t.IsDeleted == false || t.IsDeleted == null) && (t.IsTransfered == false || t.IsTransfered == null)), "Id", "Name");