Here’s my statement:
startDate = (from n in db.Nodes
where n.SeedID == mySeedID select n.CreatedDate).Max<DateTime>();
It works fine when there is data for that SeedID. However, some times the seed is new, so there are no nodes. The statement results in an InvalidOperationException. I could wrap this in try/catch. Is there a better way to deal with this scenario?
Maybe use a nullable DateTime?