Beispiel #1
0
        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)));
        }
Beispiel #3
0
 public virtual Task Handle(CreateRepositoryCommand <TModel> command, CancellationToken cancellationToken) => Save(command.Model, cancellationToken, EntityState.Added, command.UpdateModelAfterCommit);