private static void CollectEnumInfos( IEnumerable <EnumTypeExtensionNode> enumTypeExtensions, Dictionary <NameString, LeafTypeInfo> leafTypes, TypeInfos typeInfos) { foreach (EnumTypeExtensionNode scalarTypeExtension in enumTypeExtensions) { if (!leafTypes.TryGetValue( scalarTypeExtension.Name.Value, out LeafTypeInfo scalarInfo)) { var runtimeType = GetRuntimeType(scalarTypeExtension); var serializationType = GetSerializationType(scalarTypeExtension); TryRegister(typeInfos, runtimeType); TryRegister(typeInfos, serializationType); scalarInfo = new LeafTypeInfo( scalarTypeExtension.Name.Value, runtimeType?.Name, serializationType?.Name); leafTypes.Add(scalarInfo.TypeName, scalarInfo); } } }
private static void CollectScalarInfos( IEnumerable <ScalarTypeExtensionNode> scalarTypeExtensions, Dictionary <NameString, LeafTypeInfo> leafTypes) { foreach (ScalarTypeExtensionNode scalarTypeExtension in scalarTypeExtensions) { if (!leafTypes.TryGetValue( scalarTypeExtension.Name.Value, out LeafTypeInfo scalarInfo)) { scalarInfo = new LeafTypeInfo( scalarTypeExtension.Name.Value, GetDirectiveValue(scalarTypeExtension, "runtimeType"), GetDirectiveValue(scalarTypeExtension, "serializationType")); leafTypes.Add(scalarInfo.TypeName, scalarInfo); } } }