public async Task Handle(UserLocationUpdatedIntegrationEvent @event) { var userMarketingData = await _marketingDataRepository.GetAsync(@event.UserId); userMarketingData = userMarketingData ?? new MarketingData() { UserId = @event.UserId }; userMarketingData.Locations = MapUpdatedUserLocations(@event.LocationList); await _marketingDataRepository.UpdateLocationAsync(userMarketingData); }
public async Task Handle(UserLocationUpdatedIntegrationEvent message, IMessageHandlerContext context) { var userMarketingData = await _marketingDataRepository.GetAsync(message.UserId); userMarketingData = userMarketingData ?? new MarketingData() { UserId = message.UserId }; userMarketingData.Locations = MapUpdatedUserLocations(message.LocationList); await _marketingDataRepository.UpdateLocationAsync(userMarketingData); }
public async Task Handle(UserLocationUpdatedIntegrationEvent @event) { using (LogContext.PushProperty("IntegrationEventContext", $"{@event.Id}-{Program.AppName}")) { _logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, Program.AppName, @event); var userMarketingData = await _marketingDataRepository.GetAsync(@event.UserId); userMarketingData = userMarketingData ?? new MarketingData() { UserId = @event.UserId }; userMarketingData.Locations = MapUpdatedUserLocations(@event.LocationList); await _marketingDataRepository.UpdateLocationAsync(userMarketingData); } }