コード例 #1
0
 public void Configure(ConfigurationContext context, ContainerConfigurationBuilder builder)
 {
     builder.RegisterImplementationSelector(
         (interfaceType, implementationTypes, decisions) => decisions.Add(new ImplementationSelectorDecision
     {
         action = ImplementationSelectorDecision.Action.Exclude,
         target = typeof(DefaultA)
     }));
 }
コード例 #2
0
 public void Configure(ConfigurationContext context, ContainerConfigurationBuilder builder)
 {
     builder.RegisterImplementationSelector(
         delegate(Type type, Type[] types, List <ImplementationSelectorDecision> decisions)
     {
         if (type == typeof(IA))
         {
             decisions.Add(new ImplementationSelectorDecision
             {
                 target  = typeof(MyPrivateImpl),
                 action  = ImplementationSelectorDecision.Action.Include,
                 comment = "private-impl"
             });
         }
     });
 }
コード例 #3
0
                public void Configure(ConfigurationContext context, ContainerConfigurationBuilder builder)
                {
                    var selector = context.ProfileIs <InMemoryProfile>() ? GetSelector(true) : GetSelector(false);

                    builder.RegisterImplementationSelector(selector);
                }