public FromBinderNonGeneric To( Action <ConventionSelectTypesBinder> generator) { var bindInfo = new ConventionBindInfo(); // Automatically filter by the given contract types bindInfo.AddTypeFilter( concreteType => BindInfo.ContractTypes.All(contractType => concreteType.DerivesFromOrEqual(contractType))); generator(new ConventionSelectTypesBinder(bindInfo)); return(To(bindInfo.ResolveTypes())); }
public FromBinderNonGeneric To( Action <ConventionSelectTypesBinder> generator) { var bindInfo = new ConventionBindInfo(); // This is nice because it allows us to do things like Bind(all interfaces).To(specific types) // instead of having to do Bind(all interfaces).To(specific types that inherit from one of these interfaces) BindInfo.InvalidBindResponse = InvalidBindResponses.Skip; generator(new ConventionSelectTypesBinder(bindInfo)); BindInfo.ToChoice = ToChoices.Concrete; BindInfo.ToTypes.Clear(); BindInfo.ToTypes.AddRange(bindInfo.ResolveTypes()); return(this); }
public ConventionAssemblySelectionBinder(ConventionBindInfo bindInfo) { BindInfo = bindInfo; }
public ConventionFilterTypesBinder(ConventionBindInfo bindInfo) : base(bindInfo) { }