private ResolutionScope(IResolverSelector resolverSelector, IServiceRegistrator serviceRegistrator, IExpressionBuilder expressionBuilder, IContainerContext containerContext, IResolutionScope rootScope, IResolutionScope parent, DelegateCache delegateCache, object name = null) : this(resolverSelector, serviceRegistrator, expressionBuilder, containerContext, delegateCache, name) { this.RootScope = rootScope; this.ParentScope = parent; }
public static void BindPostgresRepositories(this IServiceRegistrator sr, SettingsModel settingsModel, string encodingKey, string encodingVector) { sr.Register <IAuthCredentialsRepository>( new AuthenticationCredentialsPostgresRepository(new PostgresConnection(settingsModel.PostgresConnString), Encoding.UTF8.GetBytes(encodingKey), Encoding.UTF8.GetBytes(encodingVector))); }
internal ResolutionScope(IResolverSelector resolverSelector, IServiceRegistrator serviceRegistrator, IExpressionBuilder expressionBuilder, IContainerContext containerContext) : this(resolverSelector, serviceRegistrator, expressionBuilder, containerContext, new DelegateCache(), null) { this.RootScope = this; }
public static void BindPostgres(this IServiceRegistrator sr, SettingsModel settingsModel, string key) { sr.Register(new PersonalDataPostgresRepository( new PostgresConnection(settingsModel.PostgresConnString))); sr.Register(new TraderDocumentsPostgresRepository(new PostgresConnection(settingsModel.PostgresConnString))); }
public ResolutionScope(IActivationContext activationContext, IServiceRegistrator serviceRegistrator, IExpressionBuilder expressionBuilder, IResolutionScope rootScope) { this.activationContext = activationContext; this.serviceRegistrator = serviceRegistrator; this.expressionBuilder = expressionBuilder; this.rootScope = rootScope; }
public ResolutionScope(IResolverSelector resolverSelector, IServiceRegistrator serviceRegistrator, IExpressionBuilder expressionBuilder, IContainerContext containerContext, IResolutionScope rootScope, IResolutionScope parent, AvlTreeKeyValue <object, Func <IResolutionScope, object> >[] serviceDelegateCache, AvlTreeKeyValue <object, Func <IResolutionScope, Delegate> >[] factoryDelegates, object name = null) : this(resolverSelector, serviceRegistrator, expressionBuilder, containerContext, serviceDelegateCache, factoryDelegates, name) { this.RootScope = rootScope; this.ParentScope = parent; }
public static void BindBlobService(this IServiceRegistrator sr, SettingsModel settingsModel) { var storageAccount = CloudStorageAccount.Parse(settingsModel.AzureStoragePdConnString); sr.Register <IAzureBlobContainer>( new MyAzureBlobContainer(storageAccount, settingsModel.AzureKycBlobContainerName) ); }
public ResolutionScope(IResolverSelector resolverSelector, IServiceRegistrator serviceRegistrator, IExpressionBuilder expressionBuilder, IContainerContext containerContext, object name = null) : this(resolverSelector, serviceRegistrator, expressionBuilder, containerContext, new AvlTreeKeyValue <object, Func <IResolutionScope, object> > [Constants.HashMapLength], new AvlTreeKeyValue <object, Func <IResolutionScope, Delegate> > [Constants.HashMapLength], name) { this.RootScope = this; this.InvalidateDelegateCache(); }
public ObjectBuilderSelector(IExpressionBuilder expressionBuilder, IServiceRegistrator serviceRegistrator) { this.builderRepository = new IObjectBuilder[] { new DefaultObjectBuilder(expressionBuilder), new FactoryObjectBuilder(expressionBuilder), new GenericTypeObjectBuilder(serviceRegistrator), new InstanceObjectBuilder(), new WireUpObjectBuilder(expressionBuilder), new FuncObjectBuilder() }; }
public static Logger BindSeqLogger(this IServiceRegistrator sr, SettingsModel settingModel) { var logger = new LoggerConfiguration() .Enrich.WithProperty("app name", AppName) .Enrich.WithHttpRequestId() .Enrich.WithHttpRequestUrl() .WriteTo.Seq(settingModel.SeqUrl) .CreateLogger(); sr.Register(logger); return(logger); }
private ResolutionScope(IResolverSelector resolverSelector, IServiceRegistrator serviceRegistrator, IExpressionBuilder expressionBuilder, IContainerContext containerContext, DelegateCache delegateCache, object name) { this.rootItem = DisposableItem.Empty; this.rootFinalizableItem = FinalizableItem.Empty; this.scopedItems = AvlTree <object> .Empty; this.scopedInstances = AvlTreeKeyValue <Type, object> .Empty; this.resolverSelector = resolverSelector; this.serviceRegistrator = serviceRegistrator; this.expressionBuilder = expressionBuilder; this.containerContext = containerContext; this.Name = name; this.delegateCache = delegateCache; }
private ResolutionScope(IResolverSelector resolverSelector, IServiceRegistrator serviceRegistrator, IExpressionBuilder expressionBuilder, IContainerContext containerContext, AvlTreeKeyValue <object, Func <IResolutionScope, object> >[] serviceDelegateCache, AvlTreeKeyValue <object, Func <IResolutionScope, Delegate> >[] factoryDelegates, object name) { this.disposed = new AtomicBool(); this.rootItem = DisposableItem.Empty; this.rootFinalizableItem = FinalizableItem.Empty; this.scopedItems = AvlTreeKeyValue <object, object> .Empty; this.scopedInstances = AvlTreeKeyValue <Type, object> .Empty; this.resolverSelector = resolverSelector; this.serviceRegistrator = serviceRegistrator; this.expressionBuilder = expressionBuilder; this.containerContext = containerContext; this.Name = name; this.serviceDelegates = serviceDelegateCache; this.factoryDelegates = factoryDelegates; this.indexBound = this.serviceDelegates.Length - 1; }
internal StashboxContainer(IContainerExtensionManager containerExtensionManager, IResolverSelector resolverSelector, IContainerConfigurator containerConfigurator, IDecoratorRepository decoratorRepository, Action <IContainerConfigurator> config = null) { this.containerExtensionManager = containerExtensionManager; this.resolverSelector = resolverSelector; config?.Invoke(containerConfigurator); this.ContainerContext = new ContainerContext(this.registrationRepository, this, new ResolutionStrategy(this.resolverSelector), containerConfigurator, decoratorRepository); var expressionBuilder = new ExpressionBuilder(this.containerExtensionManager, new ConstructorSelector()); this.serviceRegistrator = new ServiceRegistrator(this.ContainerContext, this.containerExtensionManager); this.objectBuilderSelector = new ObjectBuilderSelector(expressionBuilder, this.serviceRegistrator); this.registrationBuilder = new RegistrationBuilder(this.ContainerContext, this.objectBuilderSelector); this.RootScope = new ResolutionScope(this.resolverSelector, expressionBuilder, this.ContainerContext); this.rootResolver = (IDependencyResolver)this.RootScope; }
public RegistrationContext(Type serviceType, Type implementationType, IServiceRegistrator registrator) : base(serviceType, implementationType, registrator) { }
public DecoratorRegistrationContext(RegistrationContext registrationContext, IServiceRegistrator serviceRegistrator) { this.registrationContext = registrationContext; this.serviceRegistrator = serviceRegistrator; }
public GenericTypeObjectBuilder(IServiceRegistrator serviceRegistrator) { this.serviceRegistrator = serviceRegistrator; }