예제 #1
0
 partial void DeleteSetting(Setting instance);
예제 #2
0
 partial void InsertSetting(Setting instance);
예제 #3
0
 partial void UpdateSetting(Setting instance);
예제 #4
0
        private static void SaveStringEnumToDb(string settingName, string[] items, bool commitChanges)
        {
            lock (lockSaveStringEnumToDb1)
            {
                Setting setting = ctx.Settings.SingleOrDefault(s => s.SettingName == settingName);
                if (setting == null)
                {
                    setting = new Setting();
                    setting.SettingName = settingName;
                    ctx.Settings.InsertOnSubmit(setting);
                }
                setting.SettingValue = string.Join(",", items);

                if (commitChanges)
                {
                    ctx.SubmitChanges();
                }
            }
        }