1 write to Options
System.Text.Json (1)
System\Text\Json\Serialization\Metadata\JsonTypeInfo.cs (1)
45Options = options;
89 references to Options
Microsoft.AspNetCore.Http.Extensions (1)
src\Shared\RouteHandlers\ExecuteHandlerHelper.cs (1)
56return response.WriteAsJsonAsync<object?>(value, jsonTypeInfo.Options);
Microsoft.AspNetCore.OpenApi (2)
Extensions\JsonNodeSchemaExtensions.cs (1)
378var jsonDerivedType = context.TypeInfo.Options.GetTypeInfo(derivedType.DerivedType);
Extensions\JsonTypeInfoExtensions.cs (1)
82return type.GetSchemaReferenceId(jsonTypeInfo.Options);
Microsoft.AspNetCore.Routing (1)
src\Shared\RouteHandlers\ExecuteHandlerHelper.cs (1)
56return response.WriteAsJsonAsync<object?>(value, jsonTypeInfo.Options);
Shared (10)
JsonSchemaExporter\JsonSchemaExporter.cs (10)
73ValidateOptions(typeInfo.Options); 82GenerationState state = new(exporterOptions, typeInfo.Options); 117JsonNumberHandling effectiveNumberHandling = customNumberHandling ?? typeInfo.NumberHandling ?? typeInfo.Options.NumberHandling; 163JsonTypeInfo derivedTypeInfo = typeInfo.Options.GetTypeInfo(derivedType.DerivedType); 224JsonTypeInfo elementTypeInfo = typeInfo.Options.GetTypeInfo(nullableElementType); 244JsonUnmappedMemberHandling effectiveUnmappedMemberHandling = typeInfo.UnmappedMemberHandling ?? typeInfo.Options.UnmappedMemberHandling; 273JsonTypeInfo propertyTypeInfo = typeInfo.Options.GetTypeInfo(property.PropertyType); 347JsonTypeInfo elementTypeInfo = typeInfo.Options.GetTypeInfo(elementType); 398JsonTypeInfo valueTypeInfo = typeInfo.Options.GetTypeInfo(valueType); 736converter = factory.CreateConverter(typeInfo.Type, typeInfo.Options)!;
System.Text.Json (75)
System\Text\Json\Nodes\JsonValueOfTCustomized.cs (1)
38if (options != null && options != jsonTypeInfo.Options)
System\Text\Json\Schema\JsonSchemaExporter.cs (6)
57ValidateOptions(typeInfo.Options); 61GenerationState state = new(typeInfo.Options, exporterOptions); 90JsonNumberHandling effectiveNumberHandling = customNumberHandling ?? typeInfo.NumberHandling ?? typeInfo.Options.NumberHandling; 134JsonTypeInfo derivedTypeInfo = typeInfo.Options.GetTypeInfoInternal(derivedType.DerivedType); 192JsonTypeInfo elementTypeInfo = typeInfo.Options.GetTypeInfo(elementConverter.Type!); 211JsonUnmappedMemberHandling effectiveUnmappedMemberHandling = typeInfo.UnmappedMemberHandling ?? typeInfo.Options.UnmappedMemberHandling;
System\Text\Json\Serialization\JsonSerializer.Read.HandleMetadata.cs (1)
31bool allowOutOfOrderMetadata = jsonTypeInfo.Options.AllowOutOfOrderMetadataProperties;
System\Text\Json\Serialization\JsonSerializer.Read.Node.cs (2)
156JsonSerializerOptions options = jsonTypeInfo.Options; 177JsonSerializerOptions options = jsonTypeInfo.Options;
System\Text\Json\Serialization\JsonSerializer.Read.Span.cs (2)
154var readerState = new JsonReaderState(jsonTypeInfo.Options.GetReaderOptions()); 171var readerState = new JsonReaderState(jsonTypeInfo.Options.GetReaderOptions());
System\Text\Json\Serialization\JsonSerializer.Read.Stream.cs (4)
535JsonReaderOptions readerOptions = jsonTypeInfo.Options.GetReaderOptions(); 560ReadBufferState bufferState = new(listTypeInfo.Options.DefaultBufferSize); 601var listTypeInfo = new JsonTypeInfo<List<T?>>(converter, elementTypeInfo.Options) 620var listTypeInfo = new JsonTypeInfo<List<T?>>(converter, elementTypeInfo.Options)
System\Text\Json\Serialization\JsonSerializer.Write.ByteArray.cs (2)
142Utf8JsonWriter writer = Utf8JsonWriterCache.RentWriterAndBuffer(jsonTypeInfo.Options, out PooledByteBufferWriter output); 159Utf8JsonWriter writer = Utf8JsonWriterCache.RentWriterAndBuffer(jsonTypeInfo.Options, out PooledByteBufferWriter output);
System\Text\Json\Serialization\JsonSerializer.Write.Document.cs (2)
134JsonSerializerOptions options = jsonTypeInfo.Options; 155JsonSerializerOptions options = jsonTypeInfo.Options;
System\Text\Json\Serialization\JsonSerializer.Write.Element.cs (4)
135JsonSerializerOptions options = jsonTypeInfo.Options; 137Utf8JsonWriter writer = Utf8JsonWriterCache.RentWriterAndBuffer(jsonTypeInfo.Options, out PooledByteBufferWriter output); 152JsonSerializerOptions options = jsonTypeInfo.Options; 155Utf8JsonWriter writer = Utf8JsonWriterCache.RentWriterAndBuffer(jsonTypeInfo.Options, out PooledByteBufferWriter output);
System\Text\Json\Serialization\JsonSerializer.Write.Node.cs (4)
136JsonSerializerOptions options = jsonTypeInfo.Options; 138Utf8JsonWriter writer = Utf8JsonWriterCache.RentWriterAndBuffer(jsonTypeInfo.Options, out PooledByteBufferWriter output); 154JsonSerializerOptions options = jsonTypeInfo.Options; 156Utf8JsonWriter writer = Utf8JsonWriterCache.RentWriterAndBuffer(jsonTypeInfo.Options, out PooledByteBufferWriter output);
System\Text\Json\Serialization\JsonSerializer.Write.String.cs (2)
159Utf8JsonWriter writer = Utf8JsonWriterCache.RentWriterAndBuffer(jsonTypeInfo.Options, out PooledByteBufferWriter output); 176Utf8JsonWriter writer = Utf8JsonWriterCache.RentWriterAndBuffer(jsonTypeInfo.Options, out PooledByteBufferWriter output);
System\Text\Json\Serialization\JsonSerializerOptions.cs (1)
1001if (info.Options != this)
System\Text\Json\Serialization\Metadata\DefaultJsonTypeInfoResolver.Helpers.cs (3)
105JsonTypeInfo.PropertyHierarchyResolutionState state = new(typeInfo.Options); 184if (hasJsonIncludeAttribute || (fieldInfo.IsPublic && typeInfo.Options.IncludeFields)) 209JsonPropertyInfo? jsonPropertyInfo = CreatePropertyInfo(typeInfo, typeToConvert, memberInfo, nullabilityCtx, typeInfo.Options, shouldCheckForRequiredKeyword, hasJsonIncludeAttribute);
System\Text\Json\Serialization\Metadata\JsonMetadataServices.Helpers.cs (3)
141JsonSerializerContext? context = typeInfo.Options.TypeInfoResolver as JsonSerializerContext; 146JsonTypeInfo.PropertyHierarchyResolutionState state = new(typeInfo.Options); 161if (jsonPropertyInfo.MemberType == MemberTypes.Field && !jsonPropertyInfo.SrcGen_HasJsonInclude && !typeInfo.Options.IncludeFields)
System\Text\Json\Serialization\Metadata\JsonTypeInfo.Cache.cs (1)
147(!Options.PropertyNameCaseInsensitive || propertyName.SequenceEqual(info.NameAsUtf8Bytes)))
System\Text\Json\Serialization\Metadata\JsonTypeInfo.cs (14)
376ThrowHelper.ThrowInvalidOperationException_NoMetadataForTypeProperties(Options.TypeInfoResolver, Type); 514internal JsonNumberHandling EffectiveNumberHandling => _numberHandling ?? Options.NumberHandling; 705Options.MakeReadOnly(); 710lock (Options.CacheContext) 741Debug.Assert(Monitor.IsEntered(Options.CacheContext), "Configure called directly, use EnsureConfigured which synchronizes access to this method"); 742Debug.Assert(Options.IsReadOnly); 751PolymorphicTypeResolver = new PolymorphicTypeResolver(Options, PolymorphismOptions, Type, Converter.CanHaveMetadata); 766_elementTypeInfo ??= Options.GetTypeInfoInternal(ElementType); 772_keyTypeInfo ??= Options.GetTypeInfoInternal(KeyType); 866if (Options.CanUseFastPathSerializationLogic) 872return OriginatingResolver.IsCompatibleWithOptions(Options); 1024if (Options.TryGetTypeInfoCached(propertyType, out JsonTypeInfo? jsonTypeInfo)) 1029jsonPropertyInfo = jsonTypeInfo.CreateJsonPropertyInfo(declaringTypeInfo: this, declaringType, Options); 1038parameters: new object[] { declaringType ?? Type, this, Options })!;
System\Text\Json\Serialization\Metadata\JsonTypeInfoOfT.cs (1)
143Options)
System\Text\Json\Serialization\Metadata\JsonTypeInfoOfT.ReadHelper.cs (4)
20bool success = EffectiveConverter.ReadCore(ref reader, out T? result, Options, ref state); 28JsonSerializerOptions options = Options; 61JsonSerializerOptions options = Options; 118bool success = EffectiveConverter.ReadCore(ref reader, out value, Options, ref readStack);
System\Text\Json\Serialization\Metadata\JsonTypeInfoOfT.WriteHelpers.cs (14)
45Options.TryGetPolymorphicTypeInfoForRootType(rootValue, out JsonTypeInfo? derivedTypeInfo)) 56bool success = EffectiveConverter.WriteCore(writer, rootValue, Options, ref state); 69int flushThreshold = (int)(Options.DefaultBufferSize * JsonSerializer.FlushThreshold); 70return SerializeAsync(new PooledByteBufferWriter(Options.DefaultBufferSize, utf8Json), rootValue, flushThreshold, cancellationToken, rootValueBoxed); 102Utf8JsonWriter writer = Utf8JsonWriterCache.RentWriter(Options, pipeWriter); 140Options.TryGetPolymorphicTypeInfoForRootType(rootValue, out JsonTypeInfo? derivedTypeInfo)) 161var writer = new Utf8JsonWriter(pipeWriter, Options.GetWriterOptions()); 171isFinalBlock = EffectiveConverter.WriteCore(writer, rootValue, Options, ref state); 265Utf8JsonWriter writer = Utf8JsonWriterCache.RentWriterAndBuffer(Options, out PooledByteBufferWriter bufferWriter); 287Options.TryGetPolymorphicTypeInfoForRootType(rootValue, out JsonTypeInfo? polymorphicTypeInfo)) 301using var bufferWriter = new PooledByteBufferWriter(Options.DefaultBufferSize); 302using var writer = new Utf8JsonWriter(bufferWriter, Options.GetWriterOptions()); 311isFinalBlock = EffectiveConverter.WriteCore(writer, rootValue, Options, ref state); 366if ((ulong)serializationSize > (ulong)(Options.DefaultBufferSize / 2))
System\Text\Json\Serialization\Metadata\PolymorphicTypeResolver.cs (2)
269JsonTypeInfo? candidateInfo = ResolveAncestorTypeInfo(candidate, typeInfo.Options); 281JsonTypeInfo? candidateInfo = ResolveAncestorTypeInfo(interfaceType, typeInfo.Options);
System\Text\Json\Serialization\ReadStack.cs (1)
98JsonSerializerOptions options = jsonTypeInfo.Options;
System\Text\Json\Serialization\WriteStack.cs (1)
160JsonSerializerOptions options = jsonTypeInfo.Options;