public IActionResult SaveCategory(CategoryIndexViewModel model) { var UserId = HttpContext.Session.GetString("UserId"); if (ModelState.IsValid) { var category = new Category { Id = model.Id, Description = model.Description, Weight = model.Weight, SuccessIndicator = _Services.GetKeySuccessIndicatorById(model.KSIId) }; _Services.SaveCategory(category, UserId); return(RedirectToAction("Category", new { id = model.KSIId })); } else { return(RedirectToAction("Category", new { id = model.KSIId })); } }