public static void set(string SettingName, string Value) { Setting record = Repository.Get(s => s.SettingName == SettingName).FirstOrDefault(); if (record != null) { record.Value = Value; Repository.AddOrUpdate(record); Repository.Save(); } }