1 write to TypeRef
System.Text.Json.SourceGeneration (1)
JsonSourceGenerator.Parser.cs (1)
729TypeRef = typeRef,
38 references to TypeRef
System.Text.Json.SourceGeneration (38)
JsonSourceGenerator.Emitter.cs (36)
119_typeIndex.Add(spec.TypeRef, spec); 245string typeFQN = typeMetadata.TypeRef.FullyQualifiedName; 264string typeFQN = typeMetadata.TypeRef.FullyQualifiedName; 285string typeFQN = typeMetadata.TypeRef.FullyQualifiedName; 304string typeFQN = typeMetadata.TypeRef.FullyQualifiedName; 320string typeFQN = typeMetadata.TypeRef.FullyQualifiedName; 352string typeFQN = typeGenerationSpec.TypeRef.FullyQualifiedName; 445writer.WriteLine($"foreach ({valueTypeGenerationSpec.TypeRef.FullyQualifiedName} {elementVarName} in {ValueVarName}.Span)"); 457writer.WriteLine($"foreach ({valueTypeGenerationSpec.TypeRef.FullyQualifiedName} {elementVarName} in {ValueVarName})"); 490writer.WriteLine($"foreach ({KeyValuePairTypeRef}<{keyType.FullyQualifiedName}, {valueTypeGenerationSpec.TypeRef.FullyQualifiedName}> entry in {ValueVarName})"); 541constructorInfoFactoryFunc = $"static () => typeof({typeMetadata.TypeRef.FullyQualifiedName}).GetConstructor({InstanceMemberBindingFlagsVariableName}, binder: null, {argTypes}, modifiers: null)"; 551string genericArg = typeMetadata.TypeRef.FullyQualifiedName; 566{{JsonTypeInfoLocalVariableName}} = {{JsonMetadataServicesTypeRef}}.CreateObjectInfo<{{typeMetadata.TypeRef.FullyQualifiedName}}>({{OptionsLocalVariableName}}, {{ObjectInfoVarName}}); 785string castExpr = typeGenerationSpec.TypeRef.IsValueType 825return typeGenerationSpec.TypeRef.IsValueType 853string castExpr = typeGenerationSpec.TypeRef.IsValueType 869string setterCastExpr = typeGenerationSpec.TypeRef.IsValueType 924string refPrefix = typeGenerationSpec.TypeRef.IsValueType ? "ref " : ""; 962if (typeGenerationSpec.TypeRef.IsValueType) 984if (typeGenerationSpec.TypeRef.IsValueType) 1033string refPrefix = typeGenerationSpec.TypeRef.IsValueType ? "ref " : ""; 1163string typeFQN = typeSpec.TypeRef.FullyQualifiedName; 1234return typeGenSpec.TypeRef.IsValueType 1321string exceptionMessage = string.Format(ExceptionMessages.InvalidSerializablePropertyConfiguration, typeGenSpec.TypeRef.FullyQualifiedName); 1371string? objectExpr = propertyGenSpec.DeclaringType != typeGenSpec.TypeRef 1453throw new {{JsonExceptionTypeRef}}(string.Format("{{ExceptionMessages.PropertyGetterDisallowNull}}", propertyName, {{FormatStringLiteral(typeGenSpec.TypeRef.Name)}})); 1498sb.Append($"return new {typeGenerationSpec.TypeRef.FullyQualifiedName}("); 1509sb = new($"static {ArgsVarName} => new {typeGenerationSpec.TypeRef.FullyQualifiedName}("); 1571string valueTypeRef = typeGenSpec.TypeRef.IsValueType 1572? typeGenSpec.TypeRef.FullyQualifiedName 1573: typeGenSpec.TypeRef.FullyQualifiedName + "?"; 1584if (!skipNullCheck && typeGenSpec.TypeRef.CanBeNull) 1674string typeFQN = typeMetadata.TypeRef.FullyQualifiedName; 2018if (type == typeof({{metadata.TypeRef.FullyQualifiedName}})) 2087{ IsValueTuple: true } => $"() => default({typeSpec.TypeRef.FullyQualifiedName})", 2088{ ConstructionStrategy: ObjectConstructionStrategy.ParameterlessConstructor, ConstructorIsInaccessible: false } => $"() => new {typeSpec.TypeRef.FullyQualifiedName}()",
JsonSourceGenerator.Parser.cs (2)
174GeneratedTypes = _generatedTypes.Values.OrderBy(t => t.TypeRef.FullyQualifiedName).ToImmutableEquatableArray(), 232return spec.TypeRef;