Ejemplo n.º 1
0
        public Bootstrapper(IDependencyContainer container)
        {
            container.ThrowIfNull();

            _container = container;
            _container.AddPlugin(new CorePlugin());
        }
Ejemplo n.º 2
0
        public void Configure(IDependencyContainer container)
        {
            container.ThrowIfNull();

            container.Register
            .Type <IDatabase, Database>(DependencyLifetime.Scoped)
            .Type <IAsyncDatabase, AsyncDatabase>(DependencyLifetime.Scoped);
        }
Ejemplo n.º 3
0
        public void Configure(IDependencyContainer container)
        {
            container.ThrowIfNull();

            container.Register
            .Type <IAsyncCacheProvider, AsyncMemoryCacheProvider>()
            .Type <ICacheProvider, MemoryCacheProvider>();
        }
Ejemplo n.º 4
0
        public void Configure(IDependencyContainer container)
        {
            container.ThrowIfNull();

            var configuration = new LoggerConfiguration();

            configuration.Configure();
            (container as DependencyContainer).UnityContainer.AddExtension(new LoggerConstructorInjectionExtension());

            container.Register.Instance <ILoggerFactory>(new LoggerFactory());
        }
Ejemplo n.º 5
0
        public void Configure(IDependencyContainer container)
        {
            container.ThrowIfNull();

            container.Register
            .Type(typeof(IEntityReader <>), typeof(EntityReader <>), DependencyLifetime.Scoped)
            .Type(typeof(IEntityWriter <>), typeof(EntityWriter <>), DependencyLifetime.Scoped)
            .Type(typeof(ICachedEntityReader <>), typeof(CachedEntityReader <>), DependencyLifetime.Scoped)
            .Type(typeof(IEntityMapper <,>), typeof(EntityMapper <,>), DependencyLifetime.Scoped)
            .Type <IStoredProcedureExecutor, StoredProcedureExecutor>(DependencyLifetime.Scoped)
            .Type(typeof(IAsyncEntityReader <>), typeof(AsyncEntityReader <>), DependencyLifetime.Scoped)
            .Type(typeof(IAsyncEntityWriter <>), typeof(AsyncEntityWriter <>), DependencyLifetime.Scoped)
            .Type(typeof(IAsyncCachedEntityReader <>), typeof(AsyncCachedEntityReader <>), DependencyLifetime.Scoped)
            .Type <IAsyncStoredProcedureExecutor, AsyncStoredProcedureExecutor>(DependencyLifetime.Scoped);
        }
Ejemplo n.º 6
0
        public void Configure(IDependencyContainer container)
        {
            container.ThrowIfNull();

            container.Register.Type <IMetadataProvider, MetadataProvider>();
        }
 /// <summary>
 /// Registers a generator to the resource container with all of the implemented interfaces by the type of resource then generator creates.
 /// </summary>
 /// <param name="container">The container with resources.</param>
 /// <param name="generator">The generator to bind to the container.</param>
 /// <typeparam name="T">Type of value the generator provides when requesting an instance.</typeparam>
 public static void RegisterGeneratorWithInterfaces <T>(this IDependencyContainer container, Func <T> generator)
 {
     container.ThrowIfNull(nameof(container));
     container.RegisterWithInterfaces <T>(new GeneratorBinding <T>(generator));
 }
 /// <summary>
 /// Registers an instance along with all of its implemented interfaces to the resource container.
 /// </summary>
 /// <param name="container">The container with resources.</param>
 /// <param name="instance">Instance resource to bind to the container.</param>
 /// <typeparam name="T">Type of the instance being bound.</typeparam>
 public static void RegisterInstanceWithInterfaces <T>(this IDependencyContainer container, T instance)
 {
     container.ThrowIfNull(nameof(container));
     container.RegisterWithInterfaces <T>(new InstanceBinding <T>(instance));
 }
Ejemplo n.º 9
0
        public void Configure(IDependencyContainer container)
        {
            container.ThrowIfNull();

            container.Register.Type <IDatabaseConfigurationBuilder, DatabaseConfigurationBuilder>();
        }
Ejemplo n.º 10
0
        public void Configure(IDependencyContainer container)
        {
            container.ThrowIfNull();

            container.AddPlugins(_corePlugins);
        }