Пример #1
0
        public async Task <IActionResult> PutSubCounty(int id, SubCounty subCounty)
        {
            if (id != subCounty.SubCountyID)
            {
                return(BadRequest());
            }

            _context.Entry(subCounty).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!SubCountyExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Пример #2
0
        public async Task <IActionResult> PutWard(int id, Ward ward)
        {
            if (id != ward.WardID)
            {
                return(BadRequest());
            }

            _context.Entry(ward).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!WardExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }