public IActionResult Create(HardwareViewModel hardwareViewModel, [Bind("ProductID,ProductTypeID,Name,Description,StatusID,InfoUrl,SpecificationFile")] Hardware hardware) { //upload file Tuple <string, string, bool> filePath = service.UploadProductPdf(hardwareViewModel.hardware.ProductID, hardwareViewModel.FileDescription, hardwareViewModel.File); //add FileName and FilePath to hardware so that this will be saved to the database hardware.SpecificationFileName = filePath.Item1; hardware.SpecificationFilePath = filePath.Item2; hardware.HasFile = filePath.Item3; if (ModelState.IsValid) { hardware = service.Add(hardware); return(RedirectToAction("Edit", "Hardware", new { id = hardware.ProductID })); //return RedirectToAction(nameof(Index)); } ProductTypeDropDown(hardware.ProductTypeID); StatusDropDown(hardware.StatusID); //ViewData["ProductTypeID"] = new List<SelectListItem>(service.GetSelectListProductTypeHardware()); return(View(hardwareViewModel)); }