public static void Initialize() { Resolver.Bind <IControllerFactory>().To <DefaultControllerFactory>(); Resolver.Bind <IDependencyResolver>().To <MvcControllerResolver>(); Resolver.Bind <IControllerActivator>().To <ControllerActivator>(); DependencyResolver.SetResolver(new MvcControllerResolver(DependencyResolver.Current)); }
/// <summary> /// Initializes a new instance. /// </summary> public DomainIoCContainer() { // Services. Resolver.Bind <IFlightService>().To <FlightService>(); Resolver.Bind <IAirportService>().To <AirportService>(); //// Mappers. Resolver.Bind <IDomainAutoMapper>().To <DomainAutoMapper>(); }
protected override void DoCustomBindings() { Resolver.Bind <IBindingCreator>().To <BasicBindingCreator>("oracle").SetThreadScope(); Resolver.Bind <IConfigSetTask>().To <ConfigSetTask>().SetRequestResponseScope().AllowOverride = false; Resolver.Bind <IEnvironmentTasks>().To <EnvironmentTasks>().SetRequestResponseScope().AllowOverride = false; Resolver.Bind <IRepositoryFactory>().To <RepositoryFactory>().SetSingletonScope().AllowOverride = false; Resolver.Bind <IUserFacade>().To <UserFacade>().SetRequestResponseScope().AllowOverride = false; Resolver.Bind <ICacheManagementService>().To <CacheManagementService>().SetTransientScope(); Resolver.Bind <ICacheManagementWrapper>().To <NullCacheManagementWrapper>().SetTransientScope(); Resolver.Bind <ICacheManagementWrapper>().To <AzureRedisFabricCacheManager>("Azure").SetTransientScope(); }
protected void Application_Start() { ContainerFactory.BindProviders(); Resolver.Bind <IConfigurationReader>().To <FileConfigurationReader>(); AreaRegistration.RegisterAllAreas(); WebApiConfig.Register(GlobalConfiguration.Configuration); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); AuthConfig.RegisterAuth(); }
static void MainDependencyResolver() { Resolver.Bind <ILogger, ConsoleLogger>(); Resolver.Bind <UserService, UserService>(); Resolver.Bind <QueryExecutor, QueryExecutor>(); Resolver.Bind <CommandExecutor, CommandExecutor>(); Resolver.Bind <CacheService, CacheService>(); Resolver.Bind <CreateUserHandler, CreateUserHandler>(); Resolver.Bind <IConnectionFactory>(new SqlConnectionFactory("SQL Connection", Resolver.Get <ILogger>())); Resolver.Bind <RestClient>(new RestClient("API_KEY")); var createUserHandler = Resolver.Get <CreateUserHandler>(); createUserHandler.Handle(); Console.ReadKey(); }
protected override void DoCustomBindings() { Resolver.Bind <IConfigSetTask>().To <ConfigSetTask>().SetRequestResponseScope().AllowOverride = false; Resolver.Bind <IRepositoryFactory>().To <RepositoryFactory>().SetSingletonScope().AllowOverride = false; Resolver.Bind <IUserFacade>().To <UserFacade>().SetRequestResponseScope().AllowOverride = false; }
static FlatFileSerializer() { Resolver.Bind <IFlatFileSerializer>().To <FlatFileSerializerImp>(); Resolver.Bind <IFlatFileDeserializer>().To <FlatFileDeserializerImp>(); }
protected override void DoCustomBindings() { Resolver.Bind <IReplaceableSerializer>().To <ProtobufReplaceableSerializer>().SetSingletonScope(); }