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)));
        }
Exemplo n.º 2
0
        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)));
        }
Exemplo n.º 3
0
        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);
        }