public override bool MatchInjectionConfigurationSet(InjectionConfigurationSet configSet) { //Func<IResolutionContext, T> var delegateType = _factory.GetType(); if (!delegateType.IsGenericType) { return(false); } var genDef = delegateType.GetGenericTypeDefinition(); if (genDef != typeof(Func <,>)) { return(false); } var genParams = delegateType.GetGenericArguments(); if (genParams.Length != 2) { return(false); } return(genParams[0] == typeof(IResolutionContext) && genParams[1] == MyDescription.ContractType); }
public abstract bool MatchInjectionConfigurationSet(InjectionConfigurationSet configSet);
public override bool MatchInjectionConfigurationSet(InjectionConfigurationSet configSet) { return(MyDescription.ContractType.IsInstanceOfType(_instance)); }
public override bool MatchInjectionConfigurationSet(InjectionConfigurationSet configSet) { return(MyDescription.ContractType.IsAssignableFrom(_ctorConfigItem.Constructor.DeclaringType)); }