Is there a mechanism for querying the container to retrieve configuration information? I.e., I'd like to find out at runtime what implementation type a particular service interface has been mapped to via configuration or registration (including named
mappings). I could read the unity configuration section directly but this could require multiple lookups to resolve alias' so I was wondering if there was an easier way.
Hi gbraven, have you considered retrieving the type info to satisfy your requirement? In the following example I do a ResolveAll() but you could just as easily apply this concept to an object.
IUnityContainer container =
IEnumerable<IDoSomething> somethingList = container.ResolveAll<IDoSomething>();
foreach (IDoSomething foundSomething
Type somethingType = foundSomething.GetType();
The above generates the following information:
TYPE-INFO: GenericService LTM.Service.GenericService LTM, Version=184.108.40.206, Culture=neutral, PublicKeyToken=null
TYPE-INFO: SpecializedService LTM.Service.SpecializedService LTM, Version=220.127.116.11, Culture=neutral, PublicKeyToken=null
TYPE-INFO: BothServices LTM.Service.BothServices LTM, Version=18.104.22.168,