예제 #1
0
        public async Task <IActionResult> PutProductCategory(int id, ProductCategory productCategory)
        {
            if (id != productCategory.Id)
            {
                return(BadRequest());
            }

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

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (Exception)
            {
                throw;
            }
            return(Ok(productCategory));
        }
예제 #2
0
        public async Task <IActionResult> Put(int id, YD yd)
        {
            if (id != yd.Id)
            {
                return(BadRequest());
            }

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

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (Exception)
            {
                throw;
            }
            return(Ok(yd));
        }