I have a list with objects such as this one:
public class ReportViewModel
{
public string DocumentName { get; set; } = string.Empty;
public DateTime? DocumentDate { get; set; }
public string DocumentTypeName { get; set; } = string.Empty;
}
I want to get distinct list of objects, where I will get the newest document based on the document type, and only get the latest document for each type. The api currently returns list with documents and it might documents from the same document type but from a different date, how can I get only the latest document from each document type?