示例#1
0
        public void Register(ContainerBuilder builder)
        {
            builder.RegisterFeature<MappingFeature>();

            builder.RegisterFeature<PatternsFeature>();

            builder.RegisterInstance(new WestpacCsvImportDetector()).As<IImportDetector>();
            builder.RegisterInstance(new AsbOrbitFastTrackCsvImportDetector()).As<IImportDetector>();
            builder.RegisterInstance(new AsbVisaCsvImportDetector()).As<IImportDetector>();
            builder.RegisterInstance(new WestpacVisaCsvImportDetector()).As<IImportDetector>();

            builder.RegisterType<ImportDetector>();
            builder.RegisterType<TransactionImportContext>();

            builder.RegisterType<GeneralLedger>()
                .As<IAccountLookup>()
                .AsSelf();
        }
示例#2
0
文件: IoC.cs 项目: andy-uq/HomeTrack
        public static ContainerBuilder GetCompositionRoot()
        {
            var builder = new ContainerBuilder();
            builder.RegisterFeature<ApplicationFeature>();

            builder.RegisterFeature<SqlStoreFeature>();
            builder.RegisterFeature<TestLogging>();

            builder.RegisterType<TestDatabase>()
                .OnActivated(args => args.Instance.ApplyMigrations())
                .InstancePerLifetimeScope();

            builder.Register(resolver => resolver.Resolve<TestDatabase>().Database);

            builder.RegisterType<TestData.AccountLookup>()
                .As<IAccountLookup>();

            return builder;
        }
示例#3
0
文件: IoC.cs 项目: andy-uq/HomeTrack
 public void Register(ContainerBuilder builder)
 {
     builder.RegisterFeature<LoggingFeature>();
     builder.Register(resolver => LogSink.Configure(ConfigureTestLogging));
 }
示例#4
0
        private IContainer RegisterIoc(ContainerBuilder builder)
        {
            builder.RegisterType<MappingProvider>();
            builder.RegisterType<ViewModels.ViewModelTypeMapProvider>().As<ITypeMapProvider>();
            builder.Register(c => c.Resolve<MappingProvider>().Build());

            var path = MapPath("~/App_Data");
            builder.Register(c => new DirectoryExplorer(path));

            builder.RegisterFeature<ApplicationFeature>();
            builder.RegisterFeature<SqlStoreFeature>();
            RegisterDataProvider(builder);

            builder.RegisterControllers(typeof (MvcApplication).Assembly);

            IContainer container = builder.Build();
            DependencyResolver.SetResolver(new AutofacDependencyResolver(container));

            return container;
        }