linq to sql checking for null

前端 未结 4 716
别那么骄傲
别那么骄傲 2020-12-11 17:30

my database field int_ParentId consist of a Null value . how would i check it for a null in this linq query . it is not working

  return _db.Categories.Wher         


        
4条回答
  •  青春惊慌失措
    2020-12-11 18:12

    I think you want to use the object's Equals method:

    return _db.Categories.Where(m => m.int_ParentId.Equals(null)); 
    

提交回复
热议问题