예제 #1
0
        public async Task <IActionResult> CreateAsync([FromBody] CadastroClienteViewModel novo,
                                                      [FromServices] IComercianteAppServices clientAppServices)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            await clientAppServices.Insert(novo);

            return(Ok(StatusCodes.Status201Created));
        }
예제 #2
0
 public async Task <IActionResult> GetAllAsync([FromServices] IComercianteAppServices clientAppServices)
 {
     return(Ok(await clientAppServices.GetAll()));
 }