public Person(PersonCreateCommand command) { this.CopyPropertiesFrom(command); base.AddEvent(new PersonCreatedDomainEvent { AggregateRootId = Id, CommandJson = JsonConvert.SerializeObject(command), UserId = command.UserId }); }
public async Task <IActionResult> CreateAsync(PersonWriteDto p) { var command = new PersonCreateCommand { Person = p }; var response = await _mediator.Send(command); return(Ok(response)); }
public async Task <IActionResult> CreateAsync(PersonWriteDto p) { if (p != null) { var command = new PersonCreateCommand { Person = p }; await _mediator.Send(command); Log.Information("Criado com sucesso."); } Log.Error("Erro: sem objecto"); return(NoContent()); }
public IActionResult Post([FromBody] PersonCreateCommand request) { _busCommandPublisher.PublishCommandAsync(request); return(Created("", null)); }
public async Task <ActionResult> Post(PersonCreateCommand request) { await _mediator.Publish(request); return(Ok()); }
public IActionResult Post([FromBody] PersonCreateCommand command) { return(Ok(_handlerCreate.Handle(command))); }