예제 #1
0
        public async Task <IActionResult> Put(int unitId, [FromBody] Unit unit)
        {
            if (!ModelState.IsValid)
            {
                return(new BadRequestResult());
            }

            if (!await _db.IsExistingUnitAsync(unitId))
            {
                return(new NotFoundResult());
            }

            await _db.UpdateUnitAsync(unit);

            return(new NoContentResult());
        }