public async Task <IActionResult> Create(ProductCreateDto model) { await _productProxy.Create(model, ModelState); if (!ModelState.IsValid) { return(View(model)); } return(RedirectToAction("Index")); }
public async Task <IActionResult> Create(ProductCreateViewParameters parameters) { var user = (TokenUser)HttpContext.Items["User"]; await _productProxy.Create(user.Token, new ProductCreateParameters { Name = parameters.Product.Name, TicketPriority = parameters.Product.TicketPriority }); TempData["message"] = $"Product created successfully!."; return(RedirectToAction("Index")); }