Exemplo n.º 1
0
        public async Task <IActionResult> PutProduct_sub_Category(int id, Product_subCategory product_sub_Category)
        {
            if (id != product_sub_Category.id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Exemplo n.º 2
0
        public async Task <ActionResult <Product_subCategory> > PostProduct_sub_Category(Product_subCategory product_sub_Category)
        {
            _context.Product_subCategory.Add(product_sub_Category);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetProduct_sub_Category", new { id = product_sub_Category.id }, product_sub_Category));
        }