public async Task <ResponseBase> Handle(CreateBookingCommand request, CancellationToken cancellationToken) { var input = new BookingCreateInput { ArriveDate = request.ArriveDate, CustomerName = request.CustomerName, RoomName = request.RoomName }; var result = await _bookingService.CreateBooking(input); return(result ? ResponseBase.Success : ResponseBase.Fail); }
public async Task <bool> CreateBooking(BookingCreateInput input) { var AggregateId = new Guid(); var bookingCreated = new BookingCreated { AggregateId = AggregateId, DateAdded = DateTime.Now, Version = 0, Data = await BuildCreateBookingEventData() }; await _eventStore.Push(bookingCreated); return(true); }