public async Task Notify(VenueLocation venueLocation) { var venueLocationChanged = new VenueLocationChanged { venueGuid = venueLocation.Venue.VenueGuid, location = new VenueLocationRepresentation { latitude = venueLocation.Latitude, longitude = venueLocation.Longitude, modifiedDate = venueLocation.ModifiedDate } }; await publishEndpoint.Publish(venueLocationChanged); }
public async Task Handle(VenueLocationChanged venueLocationChanged) { Console.WriteLine($"Updating index for venue location {venueLocationChanged.location.latitude}, {venueLocationChanged.location.longitude}."); try { string venueGuid = venueLocationChanged.venueGuid.ToString().ToLower(); VenueLocation venueLocation = VenueLocation.FromRepresentation(venueLocationChanged.location); VenueDocument updatedVenue = new VenueDocument { VenueGuid = venueGuid, Location = venueLocation }; VenueDocument venue = await venueUpdater.UpdateAndGetLatestVenue(updatedVenue); await repository.UpdateShowsWithVenueLocation(venue.VenueGuid, venue.Location); Console.WriteLine("Succeeded"); } catch (Exception ex) { Console.WriteLine(ex.Message); throw; } }