public void Update(PluginSettings settings)
 {
     using (IDbConnection db = _factory.OpenDbConnection())
     {
         db.Update<PluginSettings>(settings);
     }
 }
        public PluginSettings SettingsFor(string pluginName, bool autoCreate = true)
        {
            using (IDbConnection db = _factory.OpenDbConnection())
            {
                var settings = db.Select<PluginSettings>(ps => ps.Name == pluginName).FirstOrDefault();

                if (null == settings && autoCreate)
                {
                    settings = new PluginSettings { Name = pluginName };
                    db.Insert<PluginSettings>(settings);
                }

                return settings;
            }
        }
 /// <summary>
 /// Initialize the plugin with settings from the database. This is called once.
 /// </summary>
 /// <param name="settings"></param>
 public virtual void Initialize(PluginSettings settings, MetricService metricService)
 {
     this.Settings = settings;
     this.MetricService = metricService;
 }
 /// <summary>
 /// Initialize the plugin with settings from the database. This is called once.
 /// </summary>
 /// <param name="settings"></param>
 public virtual void Initialize(PluginSettings settings, MetricService metricService)
 {
     this.Settings      = settings;
     this.MetricService = metricService;
 }