I have a list of Forms, and in this list the forms with the same Title denotes the different version of the that form, the one with closest Creation Time (which is DateTime
type) is newer version.
So I want to select each forms last n versions using entity framework code. I used this but it still brings me the first (oldest) n versions.
List<Forms> dbResult = entities.Forms.OrderByDescending(e => e.CreationDate)
.GroupBy(e => e.Title)
.SelectMany(e => e.Take(n))
.ToList();
Where do I go wrong?