public static CollectionResultTreatment GetCollectionResultTreatment(this MethodInfo method)
        {
            CollectionResultTreatment result;

            WampResultAttribute wampResultAttribute =
                method.ReturnParameter.GetCustomAttribute <WampResultAttribute>();

            if (wampResultAttribute == null)
            {
                result = CollectionResultTreatment.SingleValue;
            }
            else
            {
                result =
                    wampResultAttribute.CollectionResultTreatment;
            }

            return(result);
        }
        public static bool HasMultivaluedResult(this MethodInfo method)
        {
            WampResultAttribute resultAttribute =
                method.ReturnParameter.GetCustomAttribute <WampResultAttribute>(true);

            Type unwrapped = TaskExtensions.UnwrapReturnType(method.ReturnType);

            if (!unwrapped.IsArray)
            {
                return(false);
            }

            if ((resultAttribute != null) &&
                (resultAttribute.CollectionResultTreatment == CollectionResultTreatment.Multivalued))
            {
                return(true);
            }

            return(false);
        }