Пример #1
0
        public IActionResult UpdateFull(int id, [FromBody] Customer customer, [FromServices] CustomerDb db)
        {
            if (customer == null)
            {
                return(StatusCode((int)HttpStatusCode.BadRequest, new { error = "cannot update with null entity" }));
            }

            int rowsAffected = _dao.UpdateFull(id, customer, db);

            if (rowsAffected <= 0)
            {
                return(StatusCode((int)HttpStatusCode.InternalServerError, new { error = "error occurred while fully updating customer" }));
            }
            return(Ok());
        }