diff --git a/src/Umbraco.Core/CoreRuntime.cs b/src/Umbraco.Core/CoreRuntime.cs index b9d096bee7..b013c44e55 100644 --- a/src/Umbraco.Core/CoreRuntime.cs +++ b/src/Umbraco.Core/CoreRuntime.cs @@ -13,6 +13,7 @@ using Umbraco.Core.IO; using Umbraco.Core.Logging; using Umbraco.Core.Models.Rdbms; using Umbraco.Core.Persistence; +using Umbraco.Core.Persistence.Mappers; using Umbraco.Core.Persistence.SqlSyntax; using Umbraco.Core.Plugins; using Umbraco.Core.Services; @@ -199,11 +200,11 @@ namespace Umbraco.Core container.Register("SqlCeSyntaxProvider"); container.Register("SqlServerSyntaxProvider"); - // fixme explain - //// register persistence mappers - means the only place the collection can be modified - //// is in a runtime - afterwards it has been frozen and it is too late - //container.RegisterCollectionBuilder() - // .Add(f => f.GetInstance().ResolveAssignedMapperTypes()); + // register persistence mappers - required by database factory so needs to be done here + // means the only place the collection can be modified is in a runtime - afterwards it + // has been frozen and it is too late + container.RegisterCollectionBuilder() + .Add(f => f.GetInstance().ResolveAssignedMapperTypes()); // register database factory // will be initialized with syntax providers and a logger, and will try to configure diff --git a/src/Umbraco.Core/DI/RepositoryCompositionRoot.cs b/src/Umbraco.Core/DI/RepositoryCompositionRoot.cs index 68e7e71dd7..82b51f8305 100644 --- a/src/Umbraco.Core/DI/RepositoryCompositionRoot.cs +++ b/src/Umbraco.Core/DI/RepositoryCompositionRoot.cs @@ -101,12 +101,6 @@ namespace Umbraco.Core.DI // awkward but it works var serviceContainer = container as IServiceContainer; if (serviceContainer == null) throw new Exception("Container is not IServiceContainer."); - - // fixme fixme fixme more - wtf? - // has moved to core runtime, why? - // register persistence mappers - serviceContainer.RegisterCollectionBuilder() - .Add(f => f.GetInstance().ResolveAssignedMapperTypes()); } } } \ No newline at end of file