protected override int Run() { _loggingFeature.Configure(); if (!(Require(_databaseFeature.Host, "host") && Require(_databaseFeature.Database, "database") && Require("username", _usernamePasswordFeature.Username) && Require("password", _usernamePasswordFeature.Password) && Require(_scriptRoot, "script root directory"))) { return(-1); } try { ApplySession.ApplyChangeScripts( _databaseFeature.Host, _databaseFeature.Database, _usernamePasswordFeature.Username, _usernamePasswordFeature.Password, _createIfMissing, _scriptRoot, _defineVariablesFeature.Variables); return(0); } catch (Exception ex) { Log.Fatal(ex, "Could not apply change scripts"); return(-1); } }
/// <summary> /// Create and run an apply session for the current user's preferences /// </summary> /// <returns></returns> public async Task ApplyAllPreferences() { if (Preferences is Preferences preferences) { var applySession = new ApplySession(SettingsManager, preferences); await applySession.Run(); } }