public async Task <IActionResult> Create([Bind("ProductId,Remarks,Code,Amount,Status")] ProductItem productItem) { if (ModelState.IsValid) { await _productItemRepository.InsertAsync(productItem); return(RedirectToAction(nameof(Index))); } ViewData["ProductId"] = new SelectList(_productRepository.Query(), "ProductId", "Code", productItem.ProductId); return(View(productItem)); }