public static string GetGraphQLName(this MethodInfo method) { string name = method.IsDefined( typeof(GraphQLNameAttribute), false) ? method.GetCustomAttribute <GraphQLNameAttribute>().Name : NormalizeMethodName(method); return(NameUtils.RemoveInvalidCharacters(name)); }
public static string GetGraphQLName(this ParameterInfo parameter) { string name = parameter.IsDefined( typeof(GraphQLNameAttribute), false) ? parameter.GetCustomAttribute <GraphQLNameAttribute>().Name : NormalizeName(parameter.Name); return(NameUtils.RemoveInvalidCharacters(name)); }
public static string GetGraphQLName(this Type type) { if (type == null) { throw new ArgumentNullException(nameof(type)); } TypeInfo typeInfo = type.GetTypeInfo(); string name = typeInfo.IsDefined( typeof(GraphQLNameAttribute), false) ? typeInfo.GetCustomAttribute <GraphQLNameAttribute>().Name : GetFromType(typeInfo); return(NameUtils.RemoveInvalidCharacters(name)); }