Antony Denyer

Tilling the land of software
  • Resolving an open generic type with Castle Windsor

    One of things I wanted to do the other day was resolve an open generic interface. Or more specifically resolve a generic type at runtime. This is what we came up with: var argumentsAsAnonymousType = typeof(IHandler) .MakeGenericType(instance.GetType()); var concrete = IoC.Container.Resolve(argumentsAsAnonymousType); The first problem was resolving an open generic type,... [Read More]