jeudi 19 mars 2015

Optional Where in Linq-to-SQL query

I'm trying to filter table only if DateTime? start is not null, but I get the exception that I touch .Value of null object. What is correct way to achieve this?



.Where(e => start.HasValue ? e.Timestamp >= start.Value : true)

Aucun commentaire:

Enregistrer un commentaire