private static IUnityContainer ConfigureContainer()
        {
            var container = new UnityContainer();

            CoreUnityConfig.Configure(container);
            UwpCoreUnityConfig.Configure(container);

            return(container);
        }
示例#2
0
        public static IUnityContainer ConfigureContainer(bool configureLocator = true)
        {
            var container = new UnityContainer();

            CoreUnityConfig.Configure(container);
            UwpCoreUnityConfig.Configure(container);
            UwpUnityConfig.Configure(container);

            if (configureLocator)
            {
                ViewModelLocator.Configure(container);
            }

            return(container);
        }
示例#3
0
        public static UnityContainer RegisterInContainer(UnityContainer container)
        {
            CoreUnityConfig.RegisterInContainer(container);
            container.RegisterType <ILogger>(new InjectionFactory((ctr, type, name) =>
            {
                ILogger log = new LoggerConfiguration()
                              .MinimumLevel.Debug()
                              .WriteTo.RollingFile(ConfigurationManager.AppSettings["LogsDir"] + @"log.txt", retainedFileCountLimit: 7)
                              .CreateLogger();
                return(log);
            }));
            string connectionStringName = "name=MVCAngularTestContext";

            container.RegisterType <IUnitOfWork, UnitOfWork>(new InjectionConstructor(connectionStringName));
            container.RegisterType(typeof(IRepository <>), typeof(GenericRepository <>));
            container.RegisterType <ILogManager, LogManager>();
            container.RegisterType <IPalindromeManager, PalindromeManager>();

            return(container);
        }