public async Task <ActionResult> CreatProduct(ProductViewModel productViewModel) { if (!IsModelValid()) { return(CustomResponse(productViewModel)); } await _productApp.Create(_mapper.Map <Product>(productViewModel)); return(CustomResponse()); }
public async Task <ActionResult <ProductViewModel> > CreateProduct(ProductViewModel productViewModel) { if (!ModelState.IsValid) { CustomResponse(ModelState, productViewModel); } await _productApp.Create(_mapper.Map <Product>(productViewModel)); //criacao do produto return(CustomResponse(productViewModel)); }