Ejemplo n.º 1
0
 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));
 }
Ejemplo n.º 2
0
        /// <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>();
        }
Ejemplo n.º 3
0
 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();
 }
Ejemplo n.º 4
0
        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();
        }
Ejemplo n.º 5
0
        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();
        }
Ejemplo n.º 6
0
 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;
 }
Ejemplo n.º 7
0
 static FlatFileSerializer()
 {
     Resolver.Bind <IFlatFileSerializer>().To <FlatFileSerializerImp>();
     Resolver.Bind <IFlatFileDeserializer>().To <FlatFileDeserializerImp>();
 }
Ejemplo n.º 8
0
 protected override void DoCustomBindings()
 {
     Resolver.Bind <IReplaceableSerializer>().To <ProtobufReplaceableSerializer>().SetSingletonScope();
 }