public void Setup() { DependencyConfig.RegisterDependencies(); _mediator = DependencyConfig.Container.GetInstance <IMediator>(); Database.MigrateToLastVersion(); }
protected void Application_Start() { AreaRegistration.RegisterAllAreas(); RouteConfig.RegisterRoutes(RouteTable.Routes); //register dependencies DependencyConfig.RegisterDependencies(); }
protected void Application_Start() { AreaRegistration.RegisterAllAreas(); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); DependencyConfig.RegisterDependencies(); }
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); }
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); }
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."); }
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); }
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)); }
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); }
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); }
public void Configuration(IAppBuilder app) { DependencyConfig.RegisterDependencies(app); }