public ActionResult Edit(int ID, Settings item, List <string> Roles) { if (ModelState.IsValid) { List <string> DomainRoles = SF.GetRoleObjectsList().Where(r => r.IsSystem == true).Select(r => r.Title).ToList(); if (Roles != null) { DomainRoles.AddRange(Roles); } item.Roles = SF.RolesListToString(DomainRoles); _db.Entry(item).State = EntityState.Modified; _db.SaveChanges(); //update lang name of pages AbstractPage ap = _db.AbstractPages.FirstOrDefault(r => r.ID == item.DomainPageID); SF.SetLanguageCode(ap, 100, item.LanguageCode); CleanCache.CleanOutputCache(); CleanCache.CleanSettingsCache(); CleanCache.CleanMenuCache(); return(RedirectToAction("Index")); } item.Roles = SF.RolesListToString(Roles); return(View(item)); }