private void Register(ContainerAdapter adapter) { adapter.RegisterInstance(RouteTable.Routes) .RegisterInstance(BuildManager) .RegisterAsSingleton <IFilterRegistry, FilterRegistry>() .RegisterAsSingleton <IFilterProvider, FilterProvider>() .RegisterAsSingleton <IModelMetadataRegistry, ModelMetadataRegistry>(); BuildManager.ConcreteTypes .Where(type => KnownTypes.BootstrapperTaskType.IsAssignableFrom(type)) .Each(type => adapter.RegisterAsSingleton(type)); BuildManager.ConcreteTypes .Where(type => KnownTypes.PerRequestTaskType.IsAssignableFrom(type)) .Each(type => adapter.RegisterAsPerRequest(type)); adapter.RegisterInstance <IServiceRegistrar>(adapter) .RegisterInstance <IDependencyResolver>(adapter) .RegisterInstance <IServiceInjector>(adapter) .RegisterInstance(adapter) .RegisterInstance(BootstrapperTasks) .RegisterInstance(PerRequestTasks) .RegisterInstance(new TypeMappingRegistry <Controller, IActionInvoker>()) .RegisterInstance(new TypeMappingRegistry <Controller, IControllerActivator>()) .RegisterInstance(new TypeMappingRegistry <IView, IViewPageActivator>()) .RegisterInstance(new TypeMappingRegistry <object, IModelBinder>()); }
/// <summary> /// Initializes a new instance of the <see cref="FilterRegistry"/> class. /// </summary> /// <param name="container">The container.</param> public FilterRegistry(ContainerAdapter container) { Invariant.IsNotNull(container, "container"); Container = container; items = new List <FilterRegistryItem>(); }
/// <summary> /// Initializes a new instance of the <see cref="ExtendedViewPageActivator"/> class. /// </summary> /// <param name="container">The container.</param> /// <param name="viewActivatorRegistry">The view activator registry.</param> public ExtendedViewPageActivator([NotNull] ContainerAdapter container, [NotNull] TypeMappingRegistry <IView, IViewPageActivator> viewActivatorRegistry) { Invariant.IsNotNull(container, "container"); Invariant.IsNotNull(viewActivatorRegistry, "viewActivatorRegistry"); Container = container; ViewActivatorRegistry = viewActivatorRegistry; }
/// <summary> /// Initializes a new instance of the <see cref="ExtendedModelBinderProvider"/> class. /// </summary> /// <param name="container">The container.</param> /// <param name="modelBinderRegistry">The model binder registry.</param> public ExtendedModelBinderProvider(ContainerAdapter container, TypeMappingRegistry <object, IModelBinder> modelBinderRegistry) { Invariant.IsNotNull(container, "container"); Invariant.IsNotNull(modelBinderRegistry, "modelBinderRegistry"); Container = container; ModelBinderRegistry = modelBinderRegistry; }
/// <summary> /// Initializes a new instance of the <see cref="ExtendedModelBinderProvider"/> class. /// </summary> /// <param name="container">The container.</param> /// <param name="modelBinderRegistry">The model binder registry.</param> public ExtendedModelBinderProvider(ContainerAdapter container, TypeMappingRegistry<object, IModelBinder> modelBinderRegistry) { Invariant.IsNotNull(container, "container"); Invariant.IsNotNull(modelBinderRegistry, "modelBinderRegistry"); Container = container; ModelBinderRegistry = modelBinderRegistry; }
/// <summary> /// Initializes a new instance of the <see cref="ExtendedViewPageActivator"/> class. /// </summary> /// <param name="container">The container.</param> /// <param name="viewActivatorRegistry">The view activator registry.</param> public ExtendedViewPageActivator(ContainerAdapter container, TypeMappingRegistry<IView, IViewPageActivator> viewActivatorRegistry) { Invariant.IsNotNull(container, "container"); Invariant.IsNotNull(viewActivatorRegistry, "viewActivatorRegistry"); Container = container; ViewActivatorRegistry = viewActivatorRegistry; }
private ContainerAdapter CreateAndSetCurrent() { ContainerAdapter adapter = CreateAdapter(); Register(adapter); DependencyResolver.SetResolver(adapter); return(adapter); }
/// <summary> /// Initializes a new instance of the <see cref="ExtendedControllerActivator"/> class. /// </summary> /// <param name="container">The container.</param> /// <param name="controllerActivatorRegistry">The controller activator registry.</param> /// <param name="actionInvokerRegistry">The action invoker registry.</param> public ExtendedControllerActivator(ContainerAdapter container, TypeMappingRegistry <Controller, IControllerActivator> controllerActivatorRegistry, TypeMappingRegistry <Controller, IActionInvoker> actionInvokerRegistry) { Invariant.IsNotNull(container, "container"); Invariant.IsNotNull(controllerActivatorRegistry, "controllerActivatorRegistry"); Invariant.IsNotNull(actionInvokerRegistry, "actionInvokerRegistry"); Container = container; ControllerActivatorRegistry = controllerActivatorRegistry; ActionInvokerRegistry = actionInvokerRegistry; }
/// <summary> /// Initializes a new instance of the <see cref="ExtendedControllerActivator"/> class. /// </summary> /// <param name="container">The container.</param> /// <param name="controllerActivatorRegistry">The controller activator registry.</param> /// <param name="actionInvokerRegistry">The action invoker registry.</param> public ExtendedControllerActivator(ContainerAdapter container, TypeMappingRegistry<Controller, IControllerActivator> controllerActivatorRegistry, TypeMappingRegistry<Controller, IActionInvoker> actionInvokerRegistry) { Invariant.IsNotNull(container, "container"); Invariant.IsNotNull(controllerActivatorRegistry, "controllerActivatorRegistry"); Invariant.IsNotNull(actionInvokerRegistry, "actionInvokerRegistry"); Container = container; ControllerActivatorRegistry = controllerActivatorRegistry; ActionInvokerRegistry = actionInvokerRegistry; }
public static FilterInfo Merge(ContainerAdapter container, FilterInfo decoratedFilters, FilterInfo registeredFilters) { Inject(container, decoratedFilters); FilterInfo mergedFilters = new FilterInfo(); MergeOrdered(mergedFilters, decoratedFilters, registeredFilters); MergeUnordered(mergedFilters, decoratedFilters, registeredFilters); return(mergedFilters); }
/// <summary> /// Initializes a new instance of the <see cref="RegisterViews"/> class. /// </summary> /// <param name="container">The container.</param> public RegisterViews(ContainerAdapter container) { Invariant.IsNotNull(container, "container"); Container = container; }
/// <summary> /// Initializes a new instance of the <see cref="RegisterModelBinderProvider"/> class. /// </summary> /// <param name="container">The container.</param> public RegisterModelBinderProvider(ContainerAdapter container) { Invariant.IsNotNull(container, "container"); Container = container; }
/// <summary> /// Initializes a new instance of the <see cref="RegisterControllerActivator"/> class. /// </summary> /// <param name="container">The container.</param> public RegisterViewPageActivator(ContainerAdapter container) { Invariant.IsNotNull(container, "container"); Container = container; }
/// <summary> /// Initializes a new instance of the <see cref="RegisterActionInvokers"/> class. /// </summary> /// <param name="container">The container.</param> public RegisterActionInvokers(ContainerAdapter container) { Invariant.IsNotNull(container, "container"); Container = container; }
/// <summary> /// Initializes a new instance of the <see cref="RegisterModelMetadata"/> class. /// </summary> /// <param name="container">The container.</param> public RegisterModelMetadata(ContainerAdapter container) { Invariant.IsNotNull(container, "container"); Container = container; }
/// <summary> /// Initializes a new instance of the <see cref="ExtendedControllerActionInvoker"/> class. /// </summary> /// <param name="container">The container.</param> public ExtendedControllerActionInvoker(ContainerAdapter container) { Invariant.IsNotNull(container, "container"); Container = container; }
/// <summary> /// Initializes a new instance of the <see cref="RegisterControllerActivator"/> class. /// </summary> /// <param name="container">The container.</param> public RegisterControllerActivator([NotNull] ContainerAdapter container) { Invariant.IsNotNull(container, "container"); Container = container; }
public UnityCallInterceptorRegistry(ContainerAdapter container) : base(container) { }
/// <summary> /// Initializes a new instance of the <see cref="RegisterValueProviderFactories"/> class. /// </summary> /// <param name="container">The container.</param> public RegisterValueProviderFactories(ContainerAdapter container) { Invariant.IsNotNull(container, "container"); Container = container; }
/// <summary> /// Initializes a new instance of the <see cref="ExtendedControllerActionInvoker"/> class. /// </summary> /// <param name="container">The container.</param> public ExtendedControllerActionInvoker([NotNull] ContainerAdapter container) { Invariant.IsNotNull(container, "container"); Container = container; }
/// <summary> /// Initializes a new instance of the <see cref="RegisterFilters"/> class. /// </summary> /// <param name="container">The container.</param> public RegisterFilters([NotNull] ContainerAdapter container) { Invariant.IsNotNull(container, "container"); Container = container; }