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