Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
        public async Task <List <Location> > SearchByCity(LocationSearch locationSearch)
        {
            var listOfSpecificCity = await context.Location.Where(l => l.City == locationSearch.City).ToListAsync();

            return(listOfSpecificCity);
        }