1 write to TypeRef
System.Text.Json.SourceGeneration (1)
JsonSourceGenerator.Parser.cs (1)
653TypeRef = typeRef,
30 references to TypeRef
System.Text.Json.SourceGeneration (30)
JsonSourceGenerator.Emitter.cs (28)
108_typeIndex.Add(spec.TypeRef, spec); 233string typeFQN = typeMetadata.TypeRef.FullyQualifiedName; 252string typeFQN = typeMetadata.TypeRef.FullyQualifiedName; 273string typeFQN = typeMetadata.TypeRef.FullyQualifiedName; 292string typeFQN = typeMetadata.TypeRef.FullyQualifiedName; 308string typeFQN = typeMetadata.TypeRef.FullyQualifiedName; 340string typeFQN = typeGenerationSpec.TypeRef.FullyQualifiedName; 433writer.WriteLine($"foreach ({valueTypeGenerationSpec.TypeRef.FullyQualifiedName} {elementVarName} in {ValueVarName}.Span)"); 445writer.WriteLine($"foreach ({valueTypeGenerationSpec.TypeRef.FullyQualifiedName} {elementVarName} in {ValueVarName})"); 478writer.WriteLine($"foreach ({KeyValuePairTypeRef}<{keyType.FullyQualifiedName}, {valueTypeGenerationSpec.TypeRef.FullyQualifiedName}> entry in {ValueVarName})"); 529constructorInfoFactoryFunc = $"static () => typeof({typeMetadata.TypeRef.FullyQualifiedName}).GetConstructor({InstanceMemberBindingFlagsVariableName}, binder: null, {argTypes}, modifiers: null)"; 539string genericArg = typeMetadata.TypeRef.FullyQualifiedName; 554{{JsonTypeInfoLocalVariableName}} = {{JsonMetadataServicesTypeRef}}.CreateObjectInfo<{{typeMetadata.TypeRef.FullyQualifiedName}}>({{OptionsLocalVariableName}}, {{ObjectInfoVarName}}); 622=> $"""static _ => throw new {InvalidOperationExceptionTypeRef}("{string.Format(ExceptionMessages.InaccessibleJsonIncludePropertiesNotSupported, typeGenerationSpec.TypeRef.Name, propertyName)}")""", 631{ CanUseSetter: true } when typeGenerationSpec.TypeRef.IsValueType 636=> $"""static (obj, value) => throw new {InvalidOperationExceptionTypeRef}("{string.Format(ExceptionMessages.InaccessibleJsonIncludePropertiesNotSupported, typeGenerationSpec.TypeRef.Name, property.MemberName)}")""", 782string exceptionMessage = string.Format(ExceptionMessages.InvalidSerializablePropertyConfiguration, typeGenSpec.TypeRef.FullyQualifiedName); 830string? objectExpr = propertyGenSpec.DeclaringType != typeGenSpec.TypeRef 906throw new {{JsonExceptionTypeRef}}(string.Format("{{ExceptionMessages.PropertyGetterDisallowNull}}", propertyName, {{FormatStringLiteral(typeGenSpec.TypeRef.Name)}})); 922StringBuilder sb = new($"static {ArgsVarName} => new {typeGenerationSpec.TypeRef.FullyQualifiedName}("); 970string valueTypeRef = typeGenSpec.TypeRef.IsValueType 971? typeGenSpec.TypeRef.FullyQualifiedName 972: typeGenSpec.TypeRef.FullyQualifiedName + "?"; 983if (!skipNullCheck && typeGenSpec.TypeRef.CanBeNull) 1071string typeFQN = typeMetadata.TypeRef.FullyQualifiedName; 1405if (type == typeof({{metadata.TypeRef.FullyQualifiedName}})) 1474{ IsValueTuple: true } => $"() => default({typeSpec.TypeRef.FullyQualifiedName})", 1475{ ConstructionStrategy: ObjectConstructionStrategy.ParameterlessConstructor } => $"() => new {typeSpec.TypeRef.FullyQualifiedName}()",
JsonSourceGenerator.Parser.cs (2)
156GeneratedTypes = _generatedTypes.Values.OrderBy(t => t.TypeRef.FullyQualifiedName).ToImmutableEquatableArray(), 214return spec.TypeRef;