Created
June 25, 2014 19:10
-
-
Save dealproc/5dfb780eb8f9dd109924 to your computer and use it in GitHub Desktop.
Resolve registered types that implement a given generic interface for Autofac
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var connectionTypes = _LifetimeScope | |
.ComponentRegistry | |
.Registrations | |
.Where(reg => | |
reg.Activator | |
.LimitType | |
.GetInterfaces() | |
.Any(iface => | |
iface.IsGenericType && iface.GetGenericTypeDefinition() == typeof(IConnectionEditorViewModel<>) | |
) | |
) | |
.Select(x => x.Activator.LimitType); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment