private IEnumerable <MethodInfo> FindMethods(EventConsumerMetadata metadata) { var methods = metadata.ContainerType.GetMethods(BindingFlags.Public | BindingFlags.Instance); var validNames = new HashSet <string>(new[] { "Handle", "HandleEvent", "Consume", "HandleAsync", "HandleEventAsync", "ConsumeAsync" }); foreach (var method in methods) { if (validNames.Contains(method.Name)) { yield return(method); } } }
public ConsumerDescriptor(EventConsumerMetadata metadata) { ContainerType = metadata.ContainerType; ModuleDescriptor = metadata.ModuleDescriptor; }