Introduced IProviderSpecificMapperFactory, to allow some NPoco mappers to only be applied for specific providers, e.g. SqlCe and the SqlCEImageMapper
This commit is contained in:
@@ -29,7 +29,7 @@ namespace Umbraco.Cms.Infrastructure.Persistence
|
||||
private readonly DatabaseSchemaCreatorFactory _databaseSchemaCreatorFactory;
|
||||
private readonly RetryPolicy _connectionRetryPolicy;
|
||||
private readonly RetryPolicy _commandRetryPolicy;
|
||||
//private readonly IEnumerable<IMapper> _mapperCollection;
|
||||
private readonly IEnumerable<IMapper> _mapperCollection;
|
||||
private readonly Guid _instanceGuid = Guid.NewGuid();
|
||||
private List<CommandInfo> _commands;
|
||||
|
||||
@@ -50,8 +50,8 @@ namespace Umbraco.Cms.Infrastructure.Persistence
|
||||
IBulkSqlInsertProvider bulkSqlInsertProvider,
|
||||
DatabaseSchemaCreatorFactory databaseSchemaCreatorFactory,
|
||||
RetryPolicy connectionRetryPolicy = null,
|
||||
RetryPolicy commandRetryPolicy = null
|
||||
/*IEnumerable<IMapper> mapperCollection = null*/)
|
||||
RetryPolicy commandRetryPolicy = null,
|
||||
IEnumerable<IMapper> mapperCollection = null)
|
||||
: base(connectionString, sqlContext.DatabaseType, provider, sqlContext.SqlSyntax.DefaultIsolationLevel)
|
||||
{
|
||||
SqlContext = sqlContext;
|
||||
@@ -60,7 +60,7 @@ namespace Umbraco.Cms.Infrastructure.Persistence
|
||||
_databaseSchemaCreatorFactory = databaseSchemaCreatorFactory;
|
||||
_connectionRetryPolicy = connectionRetryPolicy;
|
||||
_commandRetryPolicy = commandRetryPolicy;
|
||||
//_mapperCollection = mapperCollection;
|
||||
_mapperCollection = mapperCollection;
|
||||
Init();
|
||||
}
|
||||
|
||||
@@ -85,10 +85,10 @@ namespace Umbraco.Cms.Infrastructure.Persistence
|
||||
{
|
||||
EnableSqlTrace = EnableSqlTraceDefault;
|
||||
NPocoDatabaseExtensions.ConfigureNPocoBulkExtensions();
|
||||
//if (_mapperCollection != null)
|
||||
//{
|
||||
// Mappers.AddRange(_mapperCollection);
|
||||
//}
|
||||
if (_mapperCollection != null)
|
||||
{
|
||||
Mappers.AddRange(_mapperCollection);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
Reference in New Issue
Block a user