-
-
Save yngvebn/6990480 to your computer and use it in GitHub Desktop.
This file contains 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
private IEnumerable<INamedTypeSymbol> FindMessageHandlersFor(INamedTypeSymbol message, IEnumerable<INamedTypeSymbol> messageHandlers) | |
{ | |
foreach (INamedTypeSymbol handler in messageHandlers) | |
{ | |
foreach(var iface in handler.AllInterfaces) | |
{ | |
foreach(var typeArgument in iface.TypeArguments) | |
{ | |
if (typeArgument.Equals(message)) | |
{ | |
yield return handler; | |
break; | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment