The following linq2sql code is causing me much headache and I was hoping someone could help
DateTime _maxRecordedDate = (from snapshot in _ctx.Usage_Snapshots
where snapshot.server_id == server_id
orderby snapshot.reported_on descending
select snapshot.reported_on).First().Value;
This code works in LinqPad and compiles fine but when the project runs there is a 'Specified Method is Unsupported".
If I don't use Value or cast it I get the following error:
**
Cannot implicitly convert type 'System.DateTime?' to 'System.DateTime'. An explicit conversion exists (are you missing a cast?)
**