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