public async Task <PersonaViewModel> Create(CreatePersonaCommand command) { //arrange const int expectedNumberOfErrors = 0; //act var response = await appService.Create(command); //assert command.ValidateModelAnnotations().Count.Should().Be(expectedNumberOfErrors); response.Id.Should().NotBe(Guid.Empty); response.Name.Should().Be(command.Name); return(response); }
public async Task <IActionResult> Create([FromBody] CreatePersonaCommand command) { var result = await appService.Create(command); return(Created(result.Id.ToString(), result)); }
public IActionResult Post([FromBody] CreatePersonaCommand command) { return(Ok(appService.Create(command))); }