public async Task <List <PathModel> > GetPathsBySearch(PathSearch locationSearch) { List <Path> listOfLocations; if (locationSearch.searchByProperty == SearchBy.Date) { listOfLocations = await _pathRepository.GetPathsByDate(locationSearch); } else { listOfLocations = await _pathRepository.GetPathsByProperty(locationSearch); } return(_mapper.Map <List <PathModel> >(listOfLocations)); }