public async Task <IActionResult> CreateBookingRequest( [FromRoute] Guid facilityId, [FromBody] CreateBookingRequestDto request, [FromServices] IOptions <EventBusOptions> options) { var bookingId = await mediator.Send(new CreateBookingRequestCommand(request.CustomerId, facilityId, request.BookedRecords, options.Value.Exchanges)); return(Accepted()); }
public async Task <Guid> Create(CreateBookingRequestDto request) { var bookingRequest = new BookingRequest { ItemId = request.ItemId, UserId = request.UserId, StartDate = request.StartDate, EndDate = request.EndDate, Comment = request.Comment, }; await _repository.Create(bookingRequest); await _context.SaveChangesAsync(); return(bookingRequest.Id); }
public async Task <ActionResult> CreateBookingRequest([FromBody] CreateBookingRequestDto request) { var result = await _service.Create(request); return(CreatedAtAction("GetBookingRequests", result)); }