//Edit Tool GET public IActionResult Edit(int id) { var thisTool = db.Tools.FirstOrDefault(x => x.ToolId == id); List <Bay> bays = db.Bays.ToList(); List <Certification> certifications = db.Certifications.ToList(); ToolCreateVM VM = new ToolCreateVM(thisTool, bays, certifications); return(View(VM)); }
//Get Create Tool View public IActionResult Create() { Tool tool = new Tool(); List <Bay> bays = db.Bays.ToList(); List <Certification> certifications = db.Certifications.ToList(); ToolCreateVM VM = new ToolCreateVM(tool, bays, certifications); return(View(VM)); }