Entity Framework: Select Distinct with Order By
I am creating a Flot Line Chart in .Net based on the following Entity Framework result set.
I want to get a distinct list of the report categories in alphabetical order to use as a control group.
Entity Framework provides an easy Distinct() method to retrieve distinct values from a data set, but it wasn’t completely obvious to me how to make sure that it was given to me in ascending order.
Turns out, it’s pretty easy.
List<string> categories = reportSummary.Select(m => m.CategoryName).Distinct().ToList();
Hi.
StackOverFlow error for large amount of data…
what other method for use distinct without select?
when use select all record save in memory that for large amount of data StackOverFlow error happened.