Ejemplo n.º 1
0
        public async Task <IActionResult> PutPhanHoi(string id, PhanHoi phanHoi)
        {
            if (id != phanHoi.TaiKhoan)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
        public async Task <IActionResult> PutDaoDien(int id, DaoDien daoDien)
        {
            if (id != daoDien.MaDd)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> PutQuocGia(int id, QuocGia quocGia)
        {
            if (id != quocGia.MaQg)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
        public async Task <IActionResult> PutLichSuXem(string id, LichSuXem lichSuXem)
        {
            if (id != lichSuXem.TaiKhoan)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
        public async Task <IActionResult> PutTheLoai(int id, TheLoai theLoai)
        {
            if (id != theLoai.MaTl)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
        public async Task <IActionResult> PutGoiVip(int id, GoiVip goiVip)
        {
            if (id != goiVip.Idgoi)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }