Esempio n. 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);
                }
            }
        }
Esempio n. 2
0
 public ConsumerDescriptor(EventConsumerMetadata metadata)
 {
     ContainerType    = metadata.ContainerType;
     ModuleDescriptor = metadata.ModuleDescriptor;
 }