I've created an ISearchable interface that I've Typed so that I can retrieve an IEnumerable of T for the results.
I have a number of services that implement ISearchable for different domain objects ...
Container.RegisterType<ISearchable<Animal>, AnimalService>();
Container.RegisterType<ISearchable<Fish>, FishService>();
I want to resolve (through Unity) an ISearchable based on the type, but am struggling to get it to work ...
The following dosn't compile but will hopefully give an idea of what I'm trying to achieve.
Type t = typeof(Animal);
var searchProvider = _container.Resolve<ISearchable<t>>();
Any helped gratefully received!
Thanks,
Andy