Пример #1
0
        // CTOR should not throw exception except of ArgumentException;
        public DatabaseOptionsManagement(SqlServerManagement serverManagement, string databaseName = null)
        {
            if (serverManagement == null)
            {
                throw new ArgumentNullException(nameof(serverManagement));
            }

            _ServerManagement = serverManagement;

            // As comment above said,
            // serverManagement.CurrentDatabaseName can be lazy only
            _DatabaseName = new Lazy <string>(
                () => databaseName ?? serverManagement.CurrentDatabaseName,
                LazyThreadSafetyMode.ExecutionAndPublication
                );
        }
Пример #2
0
 public DatabaseSelector(SqlServerManagement owner)
 {
     Owner = owner;
 }