Ejemplo n.º 1
0
        public ILinkConsumerBuilder Handler(LinkConsumerMessageHandlerDelegate <object> value)
        {
            if (value == null)
            {
                throw new ArgumentNullException(nameof(value));
            }

            return(new LinkConsumerBuilder(
                       this,
                       messageHandlerBuilder: LinkConsumerMessageHandlerBuilder.Create(value)
                       ));
        }
Ejemplo n.º 2
0
        public ILinkConsumerBuilder Handler <TBody>(LinkConsumerMessageHandlerDelegate <TBody> value) where TBody : class
        {
            if (value == null)
            {
                throw new ArgumentNullException(nameof(value));
            }

            if (typeof(TBody) == typeof(byte[]))
            {
                return(Handler(value as LinkConsumerMessageHandlerDelegate <byte[]>));
            }

            if (typeof(TBody) == typeof(object))
            {
                return(Handler(value as LinkConsumerMessageHandlerDelegate <object>));
            }

            return(new LinkConsumerBuilder(
                       this,
                       messageHandlerBuilder: LinkConsumerMessageHandlerBuilder.Create(value)
                       ));
        }