Context.Facility
.Select( c=> new CityModel {ID = c.CityID, Name = c.CityName} ) //Column Order must be same as following GroupBy columns
.OrderBy ( c=> c.Name )
.GroupBy ( c=> new { c.Name, c.ID } ) //Multiple Column GroupBy
.Select ( c=> c.FirstOrDefault() ) //To filter out repeating
.ToList();
No comments:
Post a Comment