public void ValidateParameters(MsSqlDatabaseInstallationOptions options) { if (string.IsNullOrEmpty(options.DatabaseName)) { throw new ArgumentException("ExpectedDatabaseName cannot be null or empty."); } }
public string GetConnectionString(MsSqlDatabaseInstallationOptions options) { var builder = new SqlConnectionStringBuilder { DataSource = string.IsNullOrEmpty(options.Server) ? "(local)" : options.Server, InitialCatalog = options.DatabaseName }; if (string.IsNullOrEmpty(options.DbCreatorUserName)) { builder.IntegratedSecurity = true; } else { builder.UserID = options.DbCreatorUserName; builder.Password = options.DbCreatorPassword; } return(builder.ConnectionString); }
public MsSqlDatabaseInstaller(IOptions <MsSqlDatabaseInstallationOptions> options, ILogger <MsSqlDatabaseInstaller> logger) { _options = options.Value; _logger = logger; }