I am playing with the concept of a strategy that resembles the ArrayResolutionStrategy but works for IEnumerable<T>, IList<T> and ICollection<T>. The concept is rather simple but it gets difficult when I add ResolverOverrides to the picture.
I want the strategy to perform a ResolveAll() call that uses the specified override. The ArrayResolutionStrategy would just ignore the override and call ResolveAll() without parameters.
IBuilderContext.GetOverridenResolver(Type) returns null for either IFoo or IList<IFoo>. I checked the sources and due to the implementation of ParameterOverride.GetResolver I can only get a meaningful result if I am in a ConstructorArgumentResolutionOperation.
Which I am not.
I know that I could access the resolverOverrides field in the BuilderContext class via reflection but that would definitely harm encapsulation and couple my strategy very tightly to the implementation of BuilderContext. Not what I want either.
Any other ideas how I could solve that issue?