コード例 #1
0
        public ActionResult Post([FromBody] CreateCartViewModel cart)
        {
            try
            {
                var resultService = _cartService.Insert(_mapper.Map <Cart>(cart));

                return(StatusCode(201, new { haserror = false, errormessage = "", data = _mapper.Map <ResultCreateCartViewModel>(resultService) }));
            }
            catch (Exception ex)
            {
                return(StatusCode(500, new { haserror = true, errormessage = "Erro interno, favor contactar administrador", data = ex.Message }));
            }
        }