public void Configure(ConfigurationContext context, ServiceConfigurationBuilder <IDatabase> builder)
 {
     if (context.ProfileIs <InMemoryProfile>())
     {
         builder.Bind <InMemoryDatabase>();
     }
     else
     {
         builder.Bind <Database>();
     }
 }
Beispiel #2
0
 public void Configure(ConfigurationContext context, ServiceConfigurationBuilder <B> builder)
 {
     builder.Bind((c, t) => new B(t));
 }
Beispiel #3
0
 public void Configure(ConfigurationContext context, ServiceConfigurationBuilder <Token> builder)
 {
     builder.Bind(c => c.Get <TokenSource>().CreateToken());
 }
 public void Configure(ConfigurationContext context, ServiceConfigurationBuilder <IService> builder)
 {
     builder.Bind <ImplTwo>();
 }
 public void Configure(ConfigurationContext context, ServiceConfigurationBuilder <IA> builder)
 {
     builder.Bind <A1>();
 }
 public void Configure(ConfigurationContext context, ServiceConfigurationBuilder <SomeConstantSwitch> builder)
 {
     builder.Bind(new SomeConstantSwitch {
         Value = 42
     });
 }