public async Task <LocationResult> GetLocation(int locationId) { using (var context = new ReservationContext()) { Location location = await context.Location.FirstOrDefaultAsync(x => x.Id == locationId); if (location == null) { NotFound(); return(null); } var googleLocation = await _placesDetail.GetFor(location.PlacesId); Ok(); return(new LocationResult() { Id = location.Id, Name = location.Name, FillStatus = location.FillStatus, Capacity = location.Capacity, SlotDuration = location.SlotDuration, SlotSize = location.SlotSize, Openings = location.LocationOpenings.Select(x => new OpeningResult(x)).ToList(), Latitude = googleLocation.Latitude, Longitude = googleLocation.Longitude, Address = googleLocation.Address }); } }
public async Task <PlacesDetailResponse> TestPlaces() { var response = await _placesDetailService.GetFor("ChIJeZ0RHcNRqEcRZfunLIjlWuY"); return(response); }