public IActionResult CreateComponent(Component model) { BackEnd.Models.Component component = new BackEnd.Models.Component(); component.AdminComment = model.AdminComment; component.ComponentNumber = model.ComponentNumber; component.SerialNo = model.SerialNo; component.UserComment = model.UserComment; component.Status = model.Status.ToString(); component.CurrentLoanInformationId = Convert.ToInt64(User.Claims.ElementAt(3).Value); ComponentHandler handler = new ComponentHandler(new bachelordbContext()); handler.saveComponent(component, Int32.Parse(model.selectedCompentype)); return(RedirectToAction("Index", "HomePage")); }