public IActionResult Update([FromRoute] Guid id, [FromBody] UpdatePersonaCommand command) { if (!command.Id.Equals(id)) { return(BadRequest("Invalid Id passed from route")); } return(Ok(appService.Update(command))); }
public async Task <IActionResult> Update([FromRoute] Guid id, [FromBody] UpdatePersonaCommand command) { var result = await appService.Get(id); if (result == null) { return(NoContent()); } return(Ok(await appService.Update(command))); }
public async Task <PersonaViewModel> Update(UpdatePersonaCommand command) { //arrange const int expectedNumberOfErrors = 0; //act var response = await appService.Update(command); //assert command.ValidateModelAnnotations().Count.Should().Be(expectedNumberOfErrors); response.Id.Should().Be(command.Id); response.Name.Should().Be(command.Name); return(response); }