コード例 #1
0
ファイル: WatsonORM.cs プロジェクト: pha3z/WatsonORM
        /// <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;
        }
コード例 #2
0
ファイル: WatsonORM.cs プロジェクト: pha3z/WatsonORM
        /// <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'.");
            }
        }