public async Task <ActionResult <RepositoryModel> > Update([FromBody] UpdateRepositoryCommand model)
        {
            var(repositoryModel, isCreated) = await _mediator.Send(model);

            return(isCreated
                ? Created(string.Empty, CreateLinksForRepository(new BaseResponseModel <RepositoryModel>(repositoryModel)))
                : Ok(CreateLinksForRepository(new BaseResponseModel <RepositoryModel>(repositoryModel))));
        }
Exemple #2
0
 public virtual Task Handle(UpdateRepositoryCommand <TModel> command, CancellationToken cancellationToken) => Save(command.Model, cancellationToken, EntityState.Modified, command.UpdateModelAfterCommit);