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