public async Task <ICollection <Location> > SearchByAllParams(LocationSearch locationSearch) { var listPatient = await context.Location.Where(l => l.City == locationSearch.City && l.StartDate > locationSearch.StartDate && l.EndDate < locationSearch.EndDate).ToListAsync(); return(listPatient); }
public async Task <List <Location> > SearchBy(LocationSearch locationSearch) { var searchList = new List <Location>(); if (locationSearch.City == null) { searchList = SearchByDate(locationSearch); } else { searchList = await SearchByCity(locationSearch); } return(searchList); }
public List <Location> SearchByDate(LocationSearch locationSearch) { var listPatient = new List <Location>(); foreach (var item in context.Patient.Include(x => x.Path)) { foreach (var item2 in item.Path) { if (item2.StartDate > locationSearch.StartDate && item2.EndDate < locationSearch.EndDate) { listPatient.Add(item2); } } } return(listPatient); }
public async Task <List <Location> > SearchByCity(LocationSearch locationSearch) { var listOfSpecificCity = await context.Location.Where(l => l.City == locationSearch.City).ToListAsync(); return(listOfSpecificCity); }