public async Task <ActionResult> AddRepository([FromBody] CreateRepositoryCommand request) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var result = await Mediator.Send(request); return(Ok(result)); }
public async Task <ActionResult <RepositoryModel> > Create([FromBody] CreateRepositoryCommand model) { var response = new BaseResponseModel <RepositoryModel>(await _mediator.Send(model)); return(Created(string.Empty, CreateLinksForRepository(response))); }
public virtual Task Handle(CreateRepositoryCommand <TModel> command, CancellationToken cancellationToken) => Save(command.Model, cancellationToken, EntityState.Added, command.UpdateModelAfterCommit);