public static IUnityContainer ConfigureUnity(ISettingsContainer settingsContainer, ITracer tracer)
        {
            IUnityContainer container      = new UnityContainer();
            var             massProcessors = new IMassProcessor[]
            {
                new TaskServiceJobsMassProcessor(container),
            };
            var storageSettings = settingsContainer.AsSettings <ISqlStoreSettingsAspect>();

            var connectionStringSettings = settingsContainer.AsSettings <IConnectionStringSettings>();
            var environmentSettings      = settingsContainer.AsSettings <IEnvironmentSettings>();

            container.AttachQueryableContainerExtension()
            .UseParameterResolvers(ParameterResolvers.Defaults)
            .ConfigureMetadata()
            .ConfigureSettingsAspects(settingsContainer)
            .ConfigureTracing(tracer)
            .ConfigureSecurityAspects()
            .ConfigureQuartzRemoteControl()
            .ConfigureQuartz()
            .ConfigureIdentityInfrastructure()
            .ConfigureWcf()
            .ConfigureOperationsProcessing(connectionStringSettings, environmentSettings)
            .ConfigureStorage(storageSettings, EntryPointSpecificLifetimeManagerFactory)
            .ConfigureReplication(EntryPointSpecificLifetimeManagerFactory);

            ReplicationRoot.Instance.PerformTypesMassProcessing(massProcessors, true, typeof(object));

            LinqToDB.Common.Configuration.Linq.OptimizeJoins = false;

            return(container);
        }