Null coalesce not working in LINQ query
问题 Take this: int? item1 = null; int? item2 = null; someObjectList.Where(x => x.SomeItem1 == (item1 ?? x.SomeItem1) && x.SomeItem2 == (item2 ?? x.SomeItem2) ); Where someObjectList is not empty and SomeItem1 and SomeItem2 is null in all the objects in the list. Why is it returning nothing? EDIT: My Code: public void GetPlacementsByMaterial(long clientMaterialID) { ClientMaterial clientMaterial = ((ApplicationEntityModel)NavigationItem.ObjectContext).ClientMaterial.FirstOrDefault(x => x