public GeneralSettingsViewModel Create(Enums.EnumGeneralSetting Name, Enums.EnumSettingType Type, string Value) { var dbobj = db.GeneralSettings.Add(new Models.GeneralSettingsModel() { GeneralSetting = Name, Type = Type, Value = Value }); db.SaveChanges(); return(dbobj.ToGeneralSettingsViewModel()); }
public GeneralSettingsViewModel Update(int Id, Enums.EnumGeneralSetting Name, Enums.EnumSettingType Type, string Value) { var dbobj = db.GeneralSettings.FirstOrDefault(ln => ln.Id == Id); dbobj.GeneralSetting = Name; dbobj.Type = Type; dbobj.Value = Value; db.SaveChanges(); return(dbobj.ToGeneralSettingsViewModel()); }