Ncqrs.Eventing.Sourcing.Mapping.AttributeBasedDomainSourcedEventHandlerMappingStrategy.IsMarkedAsEventHandler C# (CSharp) Method

IsMarkedAsEventHandler() private static method

private static IsMarkedAsEventHandler ( MethodInfo target, Ncqrs.Eventing.Sourcing.Mapping.EventHandlerAttribute &attribute ) : System.Boolean
target System.Reflection.MethodInfo
attribute Ncqrs.Eventing.Sourcing.Mapping.EventHandlerAttribute
return System.Boolean
        private static Boolean IsMarkedAsEventHandler(MethodInfo target, out EventHandlerAttribute attribute)
        {
            Contract.Requires<ArgumentNullException>(target != null, "The target cannot be null.");

            var attributeType = typeof(EventHandlerAttribute);
            var attributes = target.GetCustomAttributes(attributeType, false);
            if (attributes.Length > 0)
            {
                attribute = (EventHandlerAttribute)attributes[0];
                return true;
            }

            attribute = null;
            return false;
        }