Пример #1
0
        public static string GetGraphQLDescription(
            this ICustomAttributeProvider attributeProvider)
        {
            if (attributeProvider.IsDefined(
                    typeof(GraphQLDescriptionAttribute),
                    false))
            {
                GraphQLDescriptionAttribute attribute =
                    (GraphQLDescriptionAttribute)
                    attributeProvider.GetCustomAttributes(
                        typeof(GraphQLDescriptionAttribute),
                        false)[0];
                return(attribute.Description);
            }

            return(null);
        }
        public static string GetGraphQLDescription(
            this ICustomAttributeProvider attributeProvider)
        {
            if (attributeProvider.IsDefined(
                    typeof(GraphQLDescriptionAttribute),
                    false))
            {
                GraphQLDescriptionAttribute attribute = attributeProvider.GetCustomAttributes(
                    typeof(GraphQLDescriptionAttribute),
                    false)
                                                        .OfType <GraphQLDescriptionAttribute>()
                                                        .FirstOrDefault();
                return(attribute.Description);
            }

            return(null);
        }