public Paginated <HeiatModel> Search(HeiatSearchModel model) { var query = this .AsQueryable() .Include(c => c.Location) .AsQueryable(); if (!string.IsNullOrEmpty(model.Day)) { query = query.Where(c => c.WeekDay == model.Day); } if (model.LocationId.HasValue) { query = query.Where(c => c.LocationId.Equals(model.LocationId)); } var data = query .ProjectTo <HeiatModel>() .ToPaginated(new PaginationSearchCritria { PageNumber = model.PageNumber, PageSize = model.PageSize }); return(data); }
public IActionResult Search(HeiatSearchModel model) { System.Diagnostics.Stopwatch stopwatch = new System.Diagnostics.Stopwatch(); stopwatch.Start(); var data = _heiatRepository.Search(model); stopwatch.Stop(); return(Ok(data)); }
public IActionResult ApiGet(HeiatSearchModel model) { var data = _heiatRepository.Search(model); return(Ok(data)); }