示例#1
0
        public void RegisterTypes(IUnityContainer container)
        {
            // Register services
            container.RegisterType <IBetService, BetService>();
            container.RegisterType <IBetStatisticService, BetsStatisticService>();
            container.RegisterType <ICategoryService, CategoryService>();
            container.RegisterType <IGamePropertyService, GamePropertyService>();
            container.RegisterType <IMovieService, MovieService>();
            container.RegisterType <IWatchedMovieService, WatchedMovieService>();
            container.RegisterType <IWatcheMoviesStatisticService, WatcheMoviesStatisticService>();

            // Register data types
            DataContainerManager containerManager = new DataContainerManager();

            containerManager.RegisterTypes(container);
        }
示例#2
0
        public static void RegisterTypes(IUnityContainer container)
        {
            container.RegisterType <IUnitOfWork>(
                new InjectionFactory(x =>
                                     HttpContext.Current
                                     .GetOwinContext()
                                     .Get <IUnitOfWork>()));

            container.RegisterType <ApplicationUserManager>(
                new InjectionFactory(x =>
                                     HttpContext.Current
                                     .GetOwinContext()
                                     .Get <ApplicationUserManager>()));

            container.RegisterType <ApplicationSignInManager>(
                new InjectionFactory(x =>
                                     HttpContext.Current
                                     .GetOwinContext()
                                     .Get <ApplicationSignInManager>()));

            DataContainerManager.RegisterTypes(container);
            BusinessContainerManager.RegisterTypes(container);
        }