示例#1
0
        public IActionResult PutCompany([FromRoute] int id, [FromBody] Company company)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (!_companyRepo.CompanyExists(id))
            {
                return(NotFound());
            }

            if (!_companyRepo.EditCompany(id, company))
            {
                return(BadRequest());
            }

            return(NoContent());
        }