예제 #1
0
        public async Task <IActionResult> UpdateCompany(int id, [FromBody] Company company)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            try
            {
                await _repository.UpdateCompanyAsync(id, company);

                return(Ok(company));
            }
            catch (KeyNotFoundException)
            {
                return(NotFound());
            }
        }