Exemplo n.º 1
0
 public ActionResult<Product> Create(Category category, Product product)
 {
     product.Category = category;
     _context.Product.Add(product);
     _context.SaveChanges();
     return product;
 }
Exemplo n.º 2
0
 public ActionResult <Category> Create(Category category)
 {
     _context.Category.Add(category);
     _context.SaveChanges();
     return(category);
 }