public static void SetSettingValue(Model.SettingsValue settingId, string value, string description = "") { try { //using (var db = new NewsDb()) //{ // db.Helpers.Add(new DL.Helper // { // SettingId = (int)settingId, // Value = value, // Description = settingId.GetEnumDescription(), // EntryDate = DateTime.Now // }); // db.SaveChanges(); //} } catch { //using (var db = new NewsDb()) //{ // db.Helpers.Single(s => s.SettingId == (int)settingId).Value = value; // db.SaveChanges(); //} } }
public static string GetSettingValue(Model.SettingsValue settingId) { //using (var db = new NewsDb()) //{ // try // { // return db.Helpers.Single(s => s.SettingId == (int)settingId).Value; // } // catch // { // return "0"; // } //} return(null); }