public IActionResult Save(RoleSaveModel model)//, FormCollection collection { try { var a = this.Request; var roleAndFunctonIds = Request.Form["FunctionIds"]; var roleAndCommandIds = Request.Form["CommandIds"]; RoleDal.Update(model.RoleId, roleAndFunctonIds.Count == 0 ? new List <string>() : roleAndFunctonIds.ToList(), roleAndCommandIds.Count == 0 ? new List <string>() : roleAndCommandIds.ToList()); return(Json(1)); } catch (Exception ex) { return(Json(ex.Message)); } }
public async Task Execute(RoleSaveModel model) { await _roleCommand.Execute(model); _cache.RemoveItem(Constants.RoleViewModelsCacheKey); // force cache to invalidate //TODO: publish message for new role }