LINQ 2 Entities , howto check DateTime.HasValue within the linq query

后端 未结 2 1218
一生所求
一生所求 2021-01-19 03:50

I have this method that is supposed to get the latest messages posted, from the Table (& EntitySet) called ENTRY

///method gets \"days\" as parameter, used in ne

2条回答
  •  野的像风
    2021-01-19 04:06

    What do you want to do in case DATECREATED is null?

    If you just want to ignore these records use an additional condition(or where clause):

    var entries = from ent in db.ENTRY
                  where ent.DATECREATED.HasValue && ent.DATECREATED.Value > ...
    

提交回复
热议问题