예제 #1
0
        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);
                }
            }
        }
예제 #2
0
 public ConsumerDescriptor(EventConsumerMetadata metadata)
 {
     ContainerType    = metadata.ContainerType;
     ModuleDescriptor = metadata.ModuleDescriptor;
 }