public async Task <IActionResult> CreateCalendar() { var calendarCommand = new CreateCalendarCommand("My new Calendar", new Guid("4a8ca1a8-a832-4d69-9ff5-b3549dde0407")); await _mediator.Send(calendarCommand); return(Ok()); }
public async Task <IActionResult> CreateCalendarAsync([FromBody] CreateCalendarCommand command) { _logger.LogInformation("Sending command: {CommandName} - ({@Command})", command.GetType().FullName, command); var commandResult = await _mediator.Send(command); if (!commandResult) { return(BadRequest()); } return(Ok()); }
public async Task <IActionResult> CreateCalendar(CreateCalendarCommand command) { await _mediator.Send(command); return(Ok()); }
public async Task <ActionResult <int> > Create([FromBody] CreateCalendarCommand room) { var roomId = await Mediator.Send(room); return(Ok(roomId)); }
public async Task <IActionResult> CreateCalendar([FromBody] CreateCalendarCommand request) { var response = await _calendarService.CreateCalendar(request.Name, request.Description); return(Created("", new { Id = response })); }
public async Task <ActionResult <long> > Create(CreateCalendarCommand command) { return(await Mediator.Send(command)); }