Example #1
0
        public ActionResult LSP()
        {
            // display info
            IList <IReadableSettings> rList = new List <IReadableSettings>();
            IList <IWritableSettings> wList = new List <IWritableSettings>();

            GlobalSettings g = new GlobalSettings();
            UserSettings   u = new UserSettings();

            rList.Add(g);
            rList.Add(u);
            wList.Add(g);

            var allSettings = SettingHelper.GetAllSettings(rList);

            // try to save it
            IList <IDictionary <string, string> > newSettings = new List <IDictionary <string, string> >();
            IDictionary <string, string>          app         = new Dictionary <string, string>();

            app.Add("Theme", "Admin");
            IDictionary <string, string> user = new Dictionary <string, string>();

            user.Add("DisplayName", "AAA");
            newSettings.Add(app);
            newSettings.Add(user);
            // throw exception incaseof usersetting
            SettingHelper.SetAllSettings(wList, newSettings);

            return(View());
        }