public async Task <ActionResult <Unit> > Delete(Guid id) { MediatR.Unit deleteActivity = await _mediator.Send(new Delete.Command { Id = id }); return(deleteActivity); }
public async Task <ActionResult <Unit> > Edit(Guid id, Edit.Command command) { command.Id = id; MediatR.Unit unit = await _mediator.Send(command); return(unit); }
protected async Task <IActionResult> _delete <TCommand>(TCommand command) where TCommand : class, IDeleteCommand <TEntity, TType>, new() { try { MediatR.Unit result = await _mediator.Send(command); return(new ObjectResult(result)); } catch (ArgumentNullException ex) { return(NotFound(ex)); } catch (Exception ex) { return(BadRequest(ex)); } }
public async Task <ActionResult <Unit> > Create(Create.Command command) { MediatR.Unit createActivity = await _mediator.Send(command); return(createActivity); }