Exemplo n.º 1
0
        /// <summary>
        /// Load your modules or register your services here!
        /// </summary>
        /// <param name="kernel">The kernel.</param>
        private static void RegisterServices(IKernel kernel)
        {
            var scanner = new AssemblyScanner();
            scanner.FromCallingAssembly();
            scanner.BindWith<DefaultBindingGenerator>();
            kernel.Scan(scanner);

            ProPartners.Loan.Service.Infrastructure.AppStart.RegisterAssemblies(kernel);
        }
        /// <summary>
        /// Load your modules or register your services here!
        /// </summary>
        /// <param name="kernel">The kernel.</param>
        private static void RegisterServices(IKernel kernel)
        {
            var scanner = new AssemblyScanner();
            scanner.FromCallingAssembly();

            //This will register all interfaces with concrete types based on convention
            //ex: IPersonService will register to PersonService
            scanner.BindWith<DefaultBindingGenerator>();
            kernel.Scan(scanner);

            IMapperPOC.Service.Infrustructure.AppStart.RegisterAssemblies(kernel);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Load your modules or register your services here!
        /// </summary>
        /// <param name="kernel">The kernel.</param>
        private static void RegisterServices(IKernel kernel)
        {
            var scanner = new AssemblyScanner();

            scanner.FromCallingAssembly();

            //This will register all interfaces with concrete types based on convention
            //ex: IPersonService will register to PersonService
            scanner.BindWith <DefaultBindingGenerator>();
            kernel.Scan(scanner);

            IMapperPOC.Service.Infrustructure.AppStart.RegisterAssemblies(kernel);
        }
Exemplo n.º 4
0
        public static void RegisterAssemblies(IKernel kernel)
        {
            //there are better ways to getting the namespace of the mappers, but this is the most straightforward in the POC
            const string mapperNamespace = "IMapperPOC.Service.Mappers";

            var scanner = new AssemblyScanner();
            scanner.WhereTypeIsNotInNamespace(mapperNamespace);
            scanner.FromCallingAssembly();
            scanner.BindWith<DefaultBindingGenerator>();
            kernel.Scan(scanner);

            var mapScanner = new AssemblyScanner();
            mapScanner.FromCallingAssembly();
            mapScanner.WhereTypeIsInNamespace(mapperNamespace);
            mapScanner.BindWith<DefaultBindingGenerator>();

            //only create the mappers once since AutoMapper registration has a lot of overhead.
            mapScanner.InSingletonScope();
            kernel.Scan(mapScanner);
        }
Exemplo n.º 5
0
        public static void RegisterAssemblies(IKernel kernel)
        {
            //there are better ways to getting the namespace of the mappers, but this is the most straightforward in the POC
            const string mapperNamespace = "IMapperPOC.Service.Mappers";

            var scanner = new AssemblyScanner();

            scanner.WhereTypeIsNotInNamespace(mapperNamespace);
            scanner.FromCallingAssembly();
            scanner.BindWith <DefaultBindingGenerator>();
            kernel.Scan(scanner);

            var mapScanner = new AssemblyScanner();

            mapScanner.FromCallingAssembly();
            mapScanner.WhereTypeIsInNamespace(mapperNamespace);
            mapScanner.BindWith <DefaultBindingGenerator>();

            //only create the mappers once since AutoMapper registration has a lot of overhead.
            mapScanner.InSingletonScope();
            kernel.Scan(mapScanner);
        }
Exemplo n.º 6
0
        public static void RegisterAssemblies(IKernel kernel)
        {
            if (kernel == null)
                throw new ArgumentException("can not be null", "kernel");

            kernel.Bind<IFamilyFeudSession>().To<FamilyFeudSession>().InRequestScope();
            kernel.Bind<IFamilyFeudReadOnlySession>().To<FamilyFeudReadOnlySession>().InRequestScope();

            var scanner = new AssemblyScanner();
            scanner.WhereTypeIsNotInNamespace("FamilyFeud.Service.Storage.Context");
            //scanner.WhereTypeIsNotInNamespace("ProPartners.Loan.Service.Mappers");
            scanner.FromCallingAssembly();
            scanner.BindWith<DefaultBindingGenerator>();
            kernel.Scan(scanner);

            //var mapScanner = new AssemblyScanner();
            //mapScanner.FromCallingAssembly();
            //mapScanner.WhereTypeIsInNamespace("ProPartners.Loan.Service.Mappers");
            //mapScanner.BindWith<DefaultBindingGenerator>();
            //mapScanner.InSingletonScope();
            //kernel.Scan(mapScanner);
        }