コード例 #1
0
        public async Task <IActionResult> PutLopHoc(int id, LopHoc lopHoc)
        {
            if (id != lopHoc.id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
コード例 #2
0
        public async Task <IActionResult> PutTinhThanh(int id, TinhThanh tinhThanh)
        {
            if (id != tinhThanh.id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
コード例 #3
0
        public async Task <IActionResult> PutPhuongXa(int id, PhuongXa phuongXa)
        {
            if (id != phuongXa.id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
コード例 #4
0
        public async Task <IActionResult> PutQuanHuyen(int id, QuanHuyen quanHuyen)
        {
            if (id != quanHuyen.id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }