Пример #1
0
 private void Init()
 {
     EnableSqlTrace = EnableSqlTraceDefault;
     NPocoDatabaseExtensions.ConfigureNPocoBulkExtensions();
     if (SqlContext.DatabaseType == DatabaseType.SQLCe)
     {
         Mappers.Add(new SqlCeImageMapper());
     }
 }
Пример #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="UmbracoDatabase"/> class.
        /// </summary>
        /// <remarks>Internal for unit tests only.</remarks>
        internal UmbracoDatabase(DbConnection connection, ISqlContext sqlContext, ILogger logger)
            : base(connection, sqlContext.DatabaseType, sqlContext.SqlSyntax.DefaultIsolationLevel)
        {
            SqlContext = sqlContext;
            _logger    = logger;

            EnableSqlTrace = EnableSqlTraceDefault;

            NPocoDatabaseExtensions.ConfigureNPocoBulkExtensions();
        }
Пример #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="UmbracoDatabase"/> class.
        /// </summary>
        /// <remarks>
        /// <para>Used by UmbracoDatabaseFactory to create databases.</para>
        /// <para>Also used by DatabaseBuilder for creating databases and installing/upgrading.</para>
        /// </remarks>
        public UmbracoDatabase(string connectionString, ISqlContext sqlContext, DbProviderFactory provider, ILogger logger, RetryPolicy connectionRetryPolicy = null, RetryPolicy commandRetryPolicy = null)
            : base(connectionString, sqlContext.DatabaseType, provider, sqlContext.SqlSyntax.DefaultIsolationLevel)
        {
            SqlContext = sqlContext;

            _logger = logger;
            _connectionRetryPolicy = connectionRetryPolicy;
            _commandRetryPolicy    = commandRetryPolicy;

            EnableSqlTrace = EnableSqlTraceDefault;

            NPocoDatabaseExtensions.ConfigureNPocoBulkExtensions();
        }