コード例 #1
0
        public void Setup()
        {
            DependencyConfig.RegisterDependencies();
            _mediator = DependencyConfig.Container.GetInstance <IMediator>();

            Database.MigrateToLastVersion();
        }
コード例 #2
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            RouteConfig.RegisterRoutes(RouteTable.Routes);

            //register dependencies
            DependencyConfig.RegisterDependencies();
        }
コード例 #3
0
 protected void Application_Start()
 {
     AreaRegistration.RegisterAllAreas();
     FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
     RouteConfig.RegisterRoutes(RouteTable.Routes);
     BundleConfig.RegisterBundles(BundleTable.Bundles);
     DependencyConfig.RegisterDependencies();
 }
コード例 #4
0
 protected void Application_Start()
 {
     Log.Initialize(new EventLogger());
     GlobalConfiguration.Configure(WebApiConfig.Register);
     FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
     RouteConfig.RegisterRoutes(RouteTable.Routes);
     DependencyConfig.RegisterDependencies(GlobalConfiguration.Configuration, ControllerBuilder.Current);
 }
コード例 #5
0
ファイル: Global.asax.cs プロジェクト: Pupinin/VoorbeeldCode
 protected void Application_Start()
 {
     DependencyConfig.RegisterDependencies();
     // ExamDbContext.SetInitializer();
     AreaRegistration.RegisterAllAreas();
     GlobalConfiguration.Configure(WebApiConfig.Register);
     FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
     RouteConfig.RegisterRoutes(RouteTable.Routes);
     BundleConfig.RegisterBundles(BundleTable.Bundles);
 }
コード例 #6
0
 protected void Application_Start()
 {
     AreaRegistration.RegisterAllAreas();
     FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
     RouteConfig.RegisterRoutes(RouteTable.Routes);
     BundleConfig.RegisterBundles(BundleTable.Bundles);
     DependencyConfig.RegisterDependencies();
     // Must be after DI:
     BindingConfig.Configure();
     Log.Info("App is starting.");
 }
コード例 #7
0
        public void RegisterDependencies_RegistersCorrectDependencies()
        {
            var expectedRegistrationTypes = GetExpectedRegistrationTypes();
            var resultRegistrationTypes   = new List <Type>();
            var container = CreateContainer(resultRegistrationTypes);

            DependencyConfig.RegisterDependencies(container);

            Assert.That(resultRegistrationTypes.Except(expectedRegistrationTypes), Is.Empty, "Some redundant types were registered.");
            Assert.That(expectedRegistrationTypes.Except(resultRegistrationTypes), Is.Empty, "Not all expected types were registered.");
        }
        private static IUnityContainer CreateContainer()
        {
            IUnityContainer container = new UnityContainer();

            DependencyConfig.RegisterDependencies(container);
            container
            .RegisterInstance(new HttpRequestMessage())
            .RegisterInstance(Substitute.For <ITimeManager>())
            .RegisterInstance(Substitute.For <IListRepository>());

            return(container);
        }
コード例 #9
0
        public void RegisterDependencies_RegistersRequiredDependencies()
        {
            var contractTypes = typeof(IBootstrap).Assembly.GetTypes();
            var expectedTypes = contractTypes
                                .Where(IsNotExcludedAndInterface)
                                .Concat(IncludedTypes);
            var container = new TestContainer();

            _dependencyConfig.RegisterDependencies(container);
            var actualTypes = container.GetRegisteredTypes();

            Assert.That(actualTypes, Is.EquivalentTo(expectedTypes));
        }
コード例 #10
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();

            GlobalConfiguration.Configure(WebApiConfig.Register);
            JsonConfig.Configure();
            MapperConfig.RegisterMaps();

            DependencyConfig.RegisterDependencies();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);
        }
コード例 #11
0
ファイル: Global.asax.cs プロジェクト: Lofnix/SWMGroep2
        protected void Application_Start()
        {
            GlobalConfiguration.Configuration.IncludeErrorDetailPolicy = IncludeErrorDetailPolicy.Always;
            GlobalConfiguration.Configuration.Formatters.JsonFormatter.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore;
            ApplicationDbContext.SetInitializer();

            AreaRegistration.RegisterAllAreas();
            GlobalConfiguration.Configure(WebApiConfig.Register);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);
            DependencyConfig.RegisterDependencies();
            GlobalConfiguration.Configuration.Formatters.JsonFormatter.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore;
            GlobalConfiguration.Configuration.Formatters.Remove(GlobalConfiguration.Configuration.Formatters.XmlFormatter);
        }
コード例 #12
0
ファイル: Startup.cs プロジェクト: haojunsun/DentistClinic
 public void Configuration(IAppBuilder app)
 {
     DependencyConfig.RegisterDependencies(app);
 }