IQueryable<WebEvent> mySearch =
eventDC.GetBooks()
.Where(p => p.Price.Any(d => d.EventDatetime.Month == fromDate.Month
&& d.EventDatetime.Year == fromDate.Year))
.WithGroup(groupId)
.OrderBy(p => p.Price.Where(r => r.Datetime >= fromDate)
.OrderBy(q => q.Datetime)
.FirstOrDefault().Datetime);
List<Book>ventsList = mySearch.ToList<Book>();
We have such a long query, and it consume much time to get the books and sorting, after performance test , we found response time for the page which contains this query exceed 10 seconds, and we need to seek to solve this and reduce the response time.
Do anyone have any suggestions ?