Exemple #1
0
        /// <summary>
        /// Instantiate the object.  Once constructed, call InitializeDatabase() and InitializeTable() for each table if needed.
        /// </summary>
        /// <param name="settings">Database settings.</param>
        public WatsonORM(Watson.ORM.Core.DatabaseSettings settings)
        {
            if (settings == null)
            {
                throw new ArgumentNullException(nameof(settings));
            }

            _Settings = settings;
            _Token    = _TokenSource.Token;
        }
Exemple #2
0
        /// <summary>
        /// Instantiate the object.  Once constructed, call InitializeDatabase() and InitializeTable() for each table if needed.
        /// </summary>
        /// <param name="settings">Database settings.</param>
        public WatsonORM(Watson.ORM.Core.DatabaseSettings settings)
        {
            if (settings == null)
            {
                throw new ArgumentNullException(nameof(settings));
            }

            _Settings = settings;
            _Token    = _TokenSource.Token;

            if (_Settings.Type != Core.DbTypes.SqlServer)
            {
                throw new ArgumentException("Database type in settings must be of type 'SqlServer'.");
            }
        }