public async Task <bool?> Handle(ArrangementRequestsAvailabilityCommand message, CancellationToken cancellationToken) { var application = await _applicationRepository.GetAsync(message.ApplicationId); if (application == null) { return(null); } var res = _arrangementRequestRepository.UpdateArrangementRequestsAvailability(application, message.Availabilities); var messageObj = _eventFactory.CreateBuilder("offer", "arrangement-request-availability-changed") .AddHeaderProperty("application-number", message.ApplicationNumber) .Build(); _eventBus.Publish(messageObj); return(await res); }