Esempio n. 1
0
 public void ValidateParameters(MsSqlDatabaseInstallationOptions options)
 {
     if (string.IsNullOrEmpty(options.DatabaseName))
     {
         throw new ArgumentException("ExpectedDatabaseName cannot be null or empty.");
     }
 }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
 public MsSqlDatabaseInstaller(IOptions <MsSqlDatabaseInstallationOptions> options, ILogger <MsSqlDatabaseInstaller> logger)
 {
     _options = options.Value;
     _logger  = logger;
 }