Can I enumerate type registrations in container?
I'm porting some old code based on dead unity to the Grace.
So, in one part of code I enumerate all registered types which match pattern IRendererResourceProvider<T> in container (_container.Registrations / Unity) and Resolve/Locate them all.
So, can I do the same in the Grace or I have to make some workaround?
Old code example:
foreach (var registration in (from r in _container.Registrations
where r.RegisteredType.GetGenericInterfaceArgs(typeof(IRendererResourceProvider<>)) != null
select r))
{
var resourceProvider = container
.CreateChildContainer()
.ChildLog($"resources\\{resourceIndex}")
.Resolve(registration.RegisteredType);
container.RegisterInstance(registration.RegisteredType, resourceProvider);
resourceIndex++;
}
Can I enumerate type registrations in container? I'm porting some old code based on dead unity to the Grace. So, in one part of code I enumerate all registered types which match pattern
IRendererResourceProvider<T>
in container (_container.Registrations / Unity) and Resolve/Locate them all.So, can I do the same in the Grace or I have to make some workaround?
Old code example: