91 references to new
Aspire.Dashboard (2)
Model\BrowserStorage\LocalBrowserStorage.cs (1)
12private static readonly JsonSerializerOptions s_options = new()
Otlp\Model\OtlpHelpers.cs (1)
21private static readonly JsonSerializerOptions s_jsonSerializerOptions = new JsonSerializerOptions
Aspire.Hosting (1)
src\Shared\SecretsStore.cs (1)
68var json = contents.ToJsonString(new()
BasicTestApp (1)
TestJsonSerializerOptionsProvider.cs (1)
10public static JsonSerializerOptions Options { get; } = new JsonSerializerOptions
BasicWebSite (1)
Controllers\JsonResultWithSystemTextJsonController.cs (1)
15_customSerializerSettings = new JsonSerializerOptions();
BasketService (1)
Repositories\RedisBasketRepository.cs (1)
12private static readonly JsonSerializerOptions s_jsonSerializerOptions = new()
ConfigurationSchemaGenerator (1)
ConfigSchemaEmitter.cs (1)
25private static readonly JsonSerializerOptions s_serializerOptions = new()
ConfigurationSchemaGenerator.Tests (1)
GeneratorTests.cs (1)
52private static readonly JsonSerializerOptions s_testSerializerOptions = new() { WriteIndented = true };
dotnet-user-jwts (1)
Helpers\JwtSerializerOptions.cs (1)
10public static JsonSerializerOptions Default { get; } = new()
InMemory.FunctionalTests (1)
EventSourceTests.cs (1)
460_logger?.LogInformation("{event}", JsonSerializer.Serialize(eventData, new JsonSerializerOptions
Microsoft.AspNetCore.Authentication.Core.Test (1)
AuthenticationPropertiesTests.cs (1)
375var options = new JsonSerializerOptions() { WriteIndented = true }; // Indented for readability if test fails
Microsoft.AspNetCore.Authentication.Twitter (1)
TwitterHandler.cs (1)
404public static readonly TwitterJsonContext DefaultWithOptions = new TwitterJsonContext(new JsonSerializerOptions
Microsoft.AspNetCore.Components (1)
src\Components\Shared\src\JsonSerializerOptionsProvider.cs (1)
10public static readonly JsonSerializerOptions Options = new()
Microsoft.AspNetCore.Components.Endpoints (3)
Assets\ImportMapSerializerContext.cs (1)
15public static ImportMapSerializerContext CustomEncoder => _customEncoder ??= new(new JsonSerializerOptions
src\Shared\Components\ServerComponentSerializationSettings.cs (1)
14new JsonSerializerOptions
src\Shared\Components\WebAssemblyComponentSerializationSettings.cs (1)
12new JsonSerializerOptions
Microsoft.AspNetCore.Components.Server (2)
src\Components\Shared\src\JsonSerializerOptionsProvider.cs (1)
10public static readonly JsonSerializerOptions Options = new()
src\Shared\Components\ServerComponentSerializationSettings.cs (1)
14new JsonSerializerOptions
Microsoft.AspNetCore.Components.Server.Tests (5)
ElementReferenceJsonConverterTest.cs (5)
31Converter.Write(writer, elementReference, new JsonSerializerOptions()); 50var elementReference = Converter.Read(ref reader, typeof(ElementReference), new JsonSerializerOptions()); 70var elementReference = Converter.Read(ref reader, typeof(ElementReference), new JsonSerializerOptions()); 88Converter.Read(ref reader, typeof(ElementReference), new JsonSerializerOptions()); 107Converter.Read(ref reader, typeof(ElementReference), new JsonSerializerOptions());
Microsoft.AspNetCore.Components.WebAssembly (2)
src\Components\Shared\src\JsonSerializerOptionsProvider.cs (1)
10public static readonly JsonSerializerOptions Options = new()
src\Shared\Components\WebAssemblyComponentSerializationSettings.cs (1)
12new JsonSerializerOptions
Microsoft.AspNetCore.Components.WebAssembly.Server (1)
TargetPickerUi.cs (1)
22private static readonly JsonSerializerOptions JsonOptions = new JsonSerializerOptions
Microsoft.AspNetCore.Components.WebView (2)
src\Components\Shared\src\JsonSerializerOptionsProvider.cs (1)
10public static readonly JsonSerializerOptions Options = new()
src\Shared\StaticWebAssets\ManifestStaticWebAssetFileProvider.cs (1)
330public static readonly SourceGenerationContext DefaultWithConverter = new SourceGenerationContext(new JsonSerializerOptions
Microsoft.AspNetCore.Grpc.JsonTranscoding (1)
Internal\Json\JsonConverterHelper.cs (1)
44var options = new JsonSerializerOptions
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (4)
ConverterTests\MessageTypeInfoResolverTests.cs (4)
20Assert.Null(resolver.GetTypeInfo(typeof(IMessage), new JsonSerializerOptions())); 28Assert.Null(resolver.GetTypeInfo(typeof(IMessage<HelloRequest>), new JsonSerializerOptions())); 36Assert.Null(resolver.GetTypeInfo(typeof(IBufferMessage), new JsonSerializerOptions())); 47var typeInfo = resolver.GetTypeInfo(typeof(HelloRequest), new JsonSerializerOptions());
Microsoft.AspNetCore.Grpc.Swagger (1)
GrpcSwaggerServiceExtensions.cs (1)
50var serializerOptions = s.GetService<IOptions<JsonOptions>>()?.Value?.JsonSerializerOptions ?? new JsonSerializerOptions();
Microsoft.AspNetCore.Grpc.Swagger.Tests (1)
SchemaGeneratorIntegrationTests.cs (1)
23var dataContractResolver = new GrpcDataContractResolver(new JsonSerializerDataContractResolver(new JsonSerializerOptions()), descriptorRegistry);
Microsoft.AspNetCore.Hosting (1)
src\Shared\StaticWebAssets\ManifestStaticWebAssetFileProvider.cs (1)
330public static readonly SourceGenerationContext DefaultWithConverter = new SourceGenerationContext(new JsonSerializerOptions
Microsoft.AspNetCore.Http.Extensions.Tests (11)
HttpRequestJsonExtensionsTests.cs (4)
87var options = new JsonSerializerOptions(); 219var options = new JsonSerializerOptions(); 240var options = new JsonSerializerOptions(); 262var options = new JsonSerializerOptions();
HttpResponseJsonExtensionsTests.cs (3)
66var options = new JsonSerializerOptions(); 454var options = new JsonSerializerOptions(); 475var options = new JsonSerializerOptions();
RequestDelegateFactoryTests.cs (2)
1354var deserializedResponseBody = JsonSerializer.Deserialize<JsonTodoChild>(responseBodyStream.ToArray(), new JsonSerializerOptions 2509var deserializedResponseBody = JsonSerializer.Deserialize<TodoStruct>(responseBodyStream.ToArray(), new JsonSerializerOptions
RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (1)
243var deserializedObject = JsonSerializer.Deserialize<T>(body, new JsonSerializerOptions()
RequestDelegateGenerator\RequestDelegateCreationTests.Responses.cs (1)
315var deserializedResponseBody = JsonSerializer.Deserialize<Todo>(((MemoryStream)httpContext.Response.Body).ToArray(), new JsonSerializerOptions
Microsoft.AspNetCore.Http.Microbenchmarks (1)
src\Http\Http.Extensions\test\RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (1)
243var deserializedObject = JsonSerializer.Deserialize<T>(body, new JsonSerializerOptions()
Microsoft.AspNetCore.Http.Results.Tests (4)
JsonResultTests.cs (1)
79var jsonOptions = new JsonSerializerOptions()
ResultsTests.cs (2)
934var options = new JsonSerializerOptions(); 953var options = new JsonSerializerOptions();
TypedResultsTests.cs (1)
829var options = new JsonSerializerOptions();
Microsoft.AspNetCore.Mvc.Core.Test (2)
Infrastructure\JsonResultExecutorTestBase.cs (1)
184new JsonSerializerOptions { WriteIndented = true }));
Infrastructure\SystemTextJsonResultExecutorTest.cs (1)
38return new JsonSerializerOptions { WriteIndented = true };
Microsoft.AspNetCore.Mvc.FunctionalTests (1)
TestJsonSerializationOptionsProvider.cs (1)
10public static JsonSerializerOptions Options = new JsonSerializerOptions
Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test (1)
src\Mvc\Mvc.Core\test\Infrastructure\JsonResultExecutorTestBase.cs (1)
184new JsonSerializerOptions { WriteIndented = true }));
Microsoft.AspNetCore.SignalR.Common.Tests (1)
Internal\Protocol\JsonHubProtocolTests.cs (1)
30PayloadSerializerOptions = new JsonSerializerOptions()
Microsoft.AspNetCore.SignalR.Protocols.Json (1)
Protocol\JsonHubProtocol.cs (1)
925return new JsonSerializerOptions()
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (1)
Rename\CSharpInlineRenameServiceTests.cs (1)
70var serializationOptions = new JsonSerializerOptions
Microsoft.CodeAnalysis.ExternalAccess.Razor (1)
Remote\RazorServiceDescriptorsWrapper.cs (1)
51var options = new JsonSerializerOptions();
Microsoft.CodeAnalysis.Features (1)
Intents\IntentDataProvider.cs (1)
17var serializerOptions = new JsonSerializerOptions
Microsoft.CodeAnalysis.LanguageServer.Protocol (1)
Extensions\ProtocolConversions.cs (1)
117public static JsonSerializerOptions LspJsonSerializerOptions = new JsonSerializerOptions().AddLspSerializerOptions();
Microsoft.DotNet.Build.Tasks.Workloads (1)
Msi\WorkloadManifestMsi.wix.cs (1)
79string jsonAsString = JsonSerializer.Serialize(WorkloadPackGroups, typeof(IList<WorkloadPackGroupJson>), new JsonSerializerOptions() { WriteIndented = true });
Microsoft.DotNet.Internal.SymbolHelper (1)
SymbolPromotionHelper.cs (1)
35private static readonly JsonSerializerOptions s_options = new() { PropertyNameCaseInsensitive = true };
Microsoft.DotNet.XliffTasks (1)
Model\JsonDocument.cs (1)
16private static readonly JsonSerializerOptions s_serializerOptions = new()
Microsoft.Extensions.AI.Abstractions.Tests (1)
test\Shared\JsonSchemaExporter\TestTypes.cs (1)
530Options: new() { UnmappedMemberHandling = JsonUnmappedMemberHandling.Disallow });
Microsoft.Extensions.AI.AzureAIInference.Tests (1)
AzureAIInferenceChatClientTests.cs (1)
43JsonSerializerOptions options = new();
Microsoft.Extensions.AI.Ollama.Tests (1)
OllamaChatClientTests.cs (1)
38JsonSerializerOptions options = new();
Microsoft.Extensions.AI.OpenAI.Tests (1)
OpenAIChatClientTests.cs (1)
46JsonSerializerOptions options = new();
Microsoft.Extensions.AI.Tests (1)
ChatCompletion\ChatClientStructuredOutputExtensionsTests.cs (1)
276var jso = new JsonSerializerOptions
Microsoft.JSInterop (1)
JSRuntime.cs (1)
31JsonSerializerOptions = new JsonSerializerOptions
Microsoft.ML.AutoML.Interactive (4)
AutoMLMonitorKernelExtension.cs (3)
25Formatter.Register<Parameter>((parameter) => JsonSerializer.Serialize(parameter, new JsonSerializerOptions() { WriteIndented = true, })); 52var bestTrialParam = JsonSerializer.Serialize(monitor.BestTrial.TrialSettings.Parameter, new JsonSerializerOptions() { WriteIndented = true, }); 61var activeTrialParam = JsonSerializer.Serialize(monitor.ActiveTrial.Parameter, new JsonSerializerOptions() { WriteIndented = true, });
NotebookMonitor.cs (1)
47var activeRunParam = JsonSerializer.Serialize(result.TrialSettings.Parameter, new JsonSerializerOptions() { WriteIndented = false, });
Microsoft.ML.AutoML.Tests (4)
AutoFeaturizerTests.cs (1)
26_jsonSerializerOptions = new JsonSerializerOptions()
SweepableEstimatorPipelineTest.cs (1)
29_jsonSerializerOptions = new JsonSerializerOptions()
SweepableExtensionTest.cs (1)
29_jsonSerializerOptions = new JsonSerializerOptions()
SweepablePipelineTests.cs (1)
26_jsonSerializerOptions = new JsonSerializerOptions()
Microsoft.ML.GenAI.Phi.Tests (1)
Phi3Tests.cs (1)
109var json = JsonSerializer.Serialize(sizeInMB, new JsonSerializerOptions { WriteIndented = true });
Microsoft.ML.SearchSpace (1)
Parameter.cs (1)
65private readonly JsonSerializerOptions _settings = new JsonSerializerOptions()
Microsoft.ML.SearchSpace.Tests (2)
ParameterTest.cs (1)
21private readonly JsonSerializerOptions _settings = new JsonSerializerOptions()
SearchSpaceTest.cs (1)
24private readonly JsonSerializerOptions _settings = new JsonSerializerOptions()
MSBuild (2)
JsonOutputFormatter.cs (1)
20private static readonly JsonSerializerOptions s_options = new() { AllowTrailingCommas = false, WriteIndented = true };
XMake.cs (1)
4645var options = new JsonSerializerOptions() { AllowTrailingCommas = false, WriteIndented = true };
Shared.Tests (2)
JsonSchemaExporter\JsonSchemaExporterTests.cs (1)
149var options = new JsonSerializerOptions();
JsonSchemaExporter\TestTypes.cs (1)
530Options: new() { UnmappedMemberHandling = JsonUnmappedMemberHandling.Disallow });
System.Text.Json (3)
System\Text\Json\Nodes\JsonNode.cs (1)
18private protected static readonly JsonSerializerOptions s_defaultOptions = new();
System\Text\Json\Serialization\JsonSerializerContext.cs (1)
31options = new JsonSerializerOptions { TypeInfoResolver = this };
System\Text\Json\Serialization\JsonSerializerOptions.cs (1)
166public JsonSerializerOptions(JsonSerializerDefaults defaults) : this()
Wasm.Performance.Driver (1)
BenchmarkResultsStartup.cs (1)
22var result = await JsonSerializer.DeserializeAsync<BenchmarkResult>(context.Request.Body, new JsonSerializerOptions