I have code where I am querying something from my table that has the CreateDate property. I just want to get the object with the most recent date. This is what I have:
var post = UnitOfWork.TableName.Query(postFilter);
I tried using the Max function as follows:
var post = UnitOfWork.TableName.Query(postFilter).Max(x => x.CreatedDate);
but returns only the date.
How do I return the entire object that is the most recent?
source share