예제 #1
0
 public Result Create(CreateProductModel model)
 {
     var newProduct = new Product()
     {
         Name = model.Name,
         Description = model.Description,
         Price = model.Price,
         ImagePath = model.ImagePath
     };
     Db.Products.Add(newProduct);
     Db.SaveChanges();
     return Result.Success();
 }
예제 #2
0
 public IActionResult CreateProduct(CreateProductModel model)
 {
     _productService.Create(model);
     return View("CreateProduct", model);
 }
예제 #3
0
 public IActionResult CreateProduct()
 {
     var viewModel = new CreateProductModel();
     return View("CreateProduct", viewModel);
 }