public void Handle(RequestAbsenceCommand message) { var request = MapUtil.Map <RequestAbsenceCommand, SchedulingRequest>(message); var response = _schedulingRepository.CreateScheduledingFromRequest(request); if (!response.Success) { var rejected = new ScheduleRequestRejectedEvent(request.Id.ToString(), response.Description); Bus.RaiseEvent(rejected); return; } message.RequestId = response.RequestId.ToString(); var absenceRequest = AbsenceRequest.Factory.Create( response.RequestId.ToString(), request.RequestedBy, request.StartDate, request.EndDate); var created = MapUtil.Map <AbsenceRequest, ScheduleCreatedEvent>(absenceRequest); Bus.RaiseEvent(created); }