Exemplo n.º 1
0
        public static void RegisterTypes()
        {
            RegistrationBuilder rb = new RegistrationBuilder();

            RegisterDbContexts(rb);
            RegisterRepositories(rb);
            RegisterControllers(rb);
            RegisterFactories(rb);
            RegisterMappers(rb);

            ServiceLocatorConfig._container = new CompositionContainer(
                new AssemblyCatalog(
                    Assembly.GetExecutingAssembly(),
                    rb
                    )
                );

            var resolver = new MefDependencyResolver(ServiceLocatorConfig._container);

            DependencyResolver.SetResolver(resolver);
        }
Exemplo n.º 2
0
        public static void RegisterTypes()
        {
            RegistrationBuilder rb = new RegistrationBuilder();

            RegisterDbContexts(rb);
            RegisterRepositories(rb);
            RegisterControllers(rb);
            RegisterFactories(rb);
            RegisterMappers(rb);

            ServiceLocatorConfig._container = new CompositionContainer(
                new AssemblyCatalog(
                    Assembly.GetExecutingAssembly(),
                    rb
                )
            );

            var resolver = new MefDependencyResolver(ServiceLocatorConfig._container);

            DependencyResolver.SetResolver(resolver);
        }