129 references to Serialize
Aspire.Dashboard (1)
Model\BrowserStorage\LocalBrowserStorage.cs (1)
48var json = JsonSerializer.Serialize(value, s_options);
Aspire.Hosting (1)
Dcp\Model\ModelCommon.cs (1)
115var newAnnotationVal = JsonSerializer.Serialize(values);
Aspire.Hosting.Tests (1)
Dcp\TestKubernetesService.cs (1)
50var serialized = JsonSerializer.Serialize(r);
BicepSample.ApiService (1)
Program.cs (1)
151{ "data", JsonSerializer.Serialize(entry) }
dotnet-user-jwts (4)
Commands\CreateCommand.cs (1)
274reporter.Output(JsonSerializer.Serialize(jwt, JwtSerializerOptions.Default));
Commands\ListCommand.cs (2)
57reporter.Output(JsonSerializer.Serialize(jwts, JwtSerializerOptions.Default)); 61reporter.Output(JsonSerializer.Serialize(Array.Empty<Jwt>(), JwtSerializerOptions.Default));
Helpers\DevJwtCliHelpers.cs (1)
167reporter.Output(JsonSerializer.Serialize(jwt, JwtSerializerOptions.Default));
InMemory.FunctionalTests (1)
EventSourceTests.cs (1)
460_logger?.LogInformation("{event}", JsonSerializer.Serialize(eventData, new JsonSerializerOptions
Microsoft.AspNetCore.Authentication.Core.Test (2)
AuthenticationPropertiesTests.cs (2)
321var json = JsonSerializer.Serialize(props); 376var json = JsonSerializer.Serialize(props, options);
Microsoft.AspNetCore.Authentication.Test (1)
OAuthTests.cs (1)
536var text = JsonSerializer.Serialize(content);
Microsoft.AspNetCore.Components.Endpoints (3)
Assets\ImportMapDefinition.cs (1)
208_json ??= JsonSerializer.Serialize(this, ImportMapSerializerContext.CustomEncoder.Options);
Rendering\EndpointHtmlRenderer.Streaming.cs (2)
274var serializedStartRecord = JsonSerializer.Serialize(marker, ServerComponentSerializationSettings.JsonSerializationOptions); 298var serializedEndRecord = JsonSerializer.Serialize(endMarker, ServerComponentSerializationSettings.JsonSerializationOptions);
Microsoft.AspNetCore.Components.Server (1)
ProtectedBrowserStorage\ProtectedBrowserStorage.cs (1)
125var json = JsonSerializer.Serialize(value, options: JsonSerializerOptionsProvider.Options);
Microsoft.AspNetCore.Components.Tests (2)
BindConverterTest.cs (2)
292var expected = JsonSerializer.Serialize(value); 424return JsonSerializer.Serialize((Person)value);
Microsoft.AspNetCore.Components.Web (1)
WebRenderer.cs (1)
132var argsJson = JsonSerializer.Serialize(args, newJsonOptions);
Microsoft.AspNetCore.Components.WebAssembly.Server (1)
TargetPickerUi.cs (1)
52var msg = JsonSerializer.Serialize(args);
Microsoft.AspNetCore.Components.WebView (1)
IpcCommon.cs (1)
34return $"{_ipcMessagePrefix}{JsonSerializer.Serialize(messageTypeAndArgs, JsonSerializerOptionsProvider.Options)}";
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (3)
ConverterTests\JsonConverterWriteTests.cs (3)
230var json = JsonSerializer.Serialize(v, jsonSerializerOptions); 245var json = JsonSerializer.Serialize(v, jsonSerializerOptions); 541var jsonNew = JsonSerializer.Serialize(value, jsonSerializerOptions);
Microsoft.AspNetCore.Grpc.Microbenchmarks (1)
Json\JsonWriting.cs (1)
36JsonSerializer.Serialize(_request, _serializerOptions);
Microsoft.AspNetCore.Http.Results.Tests (1)
JsonResultTests.cs (1)
109Assert.Equal(JsonSerializer.Serialize(value, options: jsonOptions), Encoding.UTF8.GetString(stream.ToArray()));
Microsoft.AspNetCore.Mvc.Core.Test (10)
Infrastructure\JsonResultExecutorTestBase.cs (10)
26var expected = Encoding.UTF8.GetBytes(JsonSerializer.Serialize(new { foo = "abcd" })); 46var expected = Encoding.UTF8.GetBytes(JsonSerializer.Serialize(new { foo = "abcd" })); 67var expected = Encoding.Unicode.GetBytes(JsonSerializer.Serialize(new { foo = "abcd" })); 91var expected = Encoding.Unicode.GetBytes(JsonSerializer.Serialize(new { foo = "abcd" })); 111var expected = Encoding.UTF8.GetBytes(JsonSerializer.Serialize(new { foo = "abcd" })); 135var expected = Encoding.UTF8.GetBytes(JsonSerializer.Serialize(new { foo = "abcd" })); 161var expected = Encoding.UTF8.GetBytes(JsonSerializer.Serialize(new { foo = "abcd" })); 182var expected = Encoding.UTF8.GetBytes(JsonSerializer.Serialize( 331var expected = JsonSerializer.Serialize(new[] { "Hello", "world" }); 349var expected = Encoding.UTF8.GetBytes(JsonSerializer.Serialize(new[] { 1, 2 }));
Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test (11)
NewtonsoftJsonResultExecutorTest.cs (1)
35var expected = System.Text.Json.JsonSerializer.Serialize(new[] { "Hello", "world" });
src\Mvc\Mvc.Core\test\Infrastructure\JsonResultExecutorTestBase.cs (10)
26var expected = Encoding.UTF8.GetBytes(JsonSerializer.Serialize(new { foo = "abcd" })); 46var expected = Encoding.UTF8.GetBytes(JsonSerializer.Serialize(new { foo = "abcd" })); 67var expected = Encoding.Unicode.GetBytes(JsonSerializer.Serialize(new { foo = "abcd" })); 91var expected = Encoding.Unicode.GetBytes(JsonSerializer.Serialize(new { foo = "abcd" })); 111var expected = Encoding.UTF8.GetBytes(JsonSerializer.Serialize(new { foo = "abcd" })); 135var expected = Encoding.UTF8.GetBytes(JsonSerializer.Serialize(new { foo = "abcd" })); 161var expected = Encoding.UTF8.GetBytes(JsonSerializer.Serialize(new { foo = "abcd" })); 182var expected = Encoding.UTF8.GetBytes(JsonSerializer.Serialize( 331var expected = JsonSerializer.Serialize(new[] { "Hello", "world" }); 349var expected = Encoding.UTF8.GetBytes(JsonSerializer.Serialize(new[] { 1, 2 }));
Microsoft.AspNetCore.Mvc.ViewFeatures (1)
Rendering\SystemTextJsonHelper.cs (1)
25var json = JsonSerializer.Serialize(value, _htmlSafeJsonSerializerOptions);
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (2)
LanguageServer\AbstractLanguageServerProtocolTests.cs (2)
127var expectedStr = JsonSerializer.Serialize(expected, JsonSerializerOptions); 128var actualStr = JsonSerializer.Serialize(actual, JsonSerializerOptions);
Microsoft.CodeAnalysis.LanguageServer (1)
Program.cs (1)
139Console.WriteLine(JsonSerializer.Serialize(new NamedPipeInformation(clientPipeName)));
Microsoft.CodeAnalysis.LanguageServer.Protocol (5)
Handler\ServerLifetime\InitializeHandler.cs (1)
44m["capabilities"] = JsonSerializer.Serialize(serverCapabilities, ProtocolConversions.LspJsonSerializerOptions);
Protocol\Internal\Efficiency\OptimizedVSCompletionListJsonConverter.cs (4)
106jsonString = JsonSerializer.Serialize(vsCompletionItem.Icon, options); 124jsonString = JsonSerializer.Serialize(basicCommitCharacters, options); 136jsonString = JsonSerializer.Serialize(augmentedCommitCharacters, options); 220jsonString = JsonSerializer.Serialize(completionItem.CommitCharacters, options);
Microsoft.CodeAnalysis.Workspaces.UnitTests (1)
UtilityTest\ExceptionHelpersTests.cs (1)
69Assert.NotNull(JsonSerializer.Serialize(e));
Microsoft.DotNet.Build.Tasks.Workloads (1)
Msi\MsiProperties.wix.cs (1)
116File.WriteAllText(msiJsonPath, JsonSerializer.Serialize(properties));
Microsoft.Extensions.AI.Tests (2)
ChatCompletion\ChatClientStructuredOutputExtensionsTests.cs (2)
81var expectedCompletion = new ChatCompletion([new ChatMessage(ChatRole.Assistant, JsonSerializer.Serialize(expectedResult))]); 250var expectedCompletion = new ChatCompletion([new ChatMessage(ChatRole.Assistant, JsonSerializer.Serialize(payload))]);
Microsoft.JSInterop (5)
Infrastructure\DotNetDispatcher.cs (3)
64return JsonSerializer.Serialize(syncResult, jsRuntime.JsonSerializerOptions); 135var syncResultJson = JsonSerializer.Serialize(syncResult, jsRuntime.JsonSerializerOptions); 152var resultJson = JsonSerializer.Serialize(result, jsRuntime.JsonSerializerOptions);
JSInProcessRuntime.cs (1)
20JsonSerializer.Serialize(args, JsonSerializerOptions),
JSRuntime.cs (1)
127JsonSerializer.Serialize(args, JsonSerializerOptions) :
Microsoft.JSInterop.Tests (19)
Infrastructure\ByteArrayJsonConverterTest.cs (2)
73var json = JsonSerializer.Serialize(expected); 226var json = JsonSerializer.Serialize(byteArray, JsonSerializerOptions);
Infrastructure\DotNetDispatcherTest.cs (11)
121var argsJson = JsonSerializer.Serialize(new object[] 161var argsJson = JsonSerializer.Serialize(new object[] 269var argsJson = JsonSerializer.Serialize(new object[] { jsRuntime.LastInvocationAsyncHandle, true, testDTO }, jsRuntime.JsonSerializerOptions); 290var argsJson = JsonSerializer.Serialize(new object[] { jsRuntime.LastInvocationAsyncHandle, false, expected }, jsRuntime.JsonSerializerOptions); 306var argsJson = JsonSerializer.Serialize(new object[] { jsRuntime.LastInvocationAsyncHandle, false, null }, jsRuntime.JsonSerializerOptions); 323var argsJson = JsonSerializer.Serialize(new object[] { jsRuntime.LastInvocationAsyncHandle, true, testDTO }, jsRuntime.JsonSerializerOptions); 544var argsJson = JsonSerializer.Serialize(new object[] 565var argsJson = JsonSerializer.Serialize(new object[] 594var argsJson = JsonSerializer.Serialize(new object[] 633var argsJson = JsonSerializer.Serialize(new object[] 661var argsJson = JsonSerializer.Serialize(new object[] { }, jsRuntime.JsonSerializerOptions);
Infrastructure\DotNetObjectReferenceJsonConverterTest.cs (2)
137var json1 = JsonSerializer.Serialize(dotNetObjectRef, JsonSerializerOptions); 138var json2 = JsonSerializer.Serialize(dotNetObjectRef, JsonSerializerOptions);
Infrastructure\DotNetStreamReferenceJsonConverterTest.cs (2)
37var json = JsonSerializer.Serialize(streamRef, JsonSerializerOptions); 52var json = JsonSerializer.Serialize(streamRef, JsonSerializerOptions);
Infrastructure\JSObjectReferenceJsonConverterTest.cs (1)
85var json = JsonSerializer.Serialize((IJSObjectReference)jsObjectRef, JsonSerializerOptions);
Infrastructure\JSStreamReferenceJsonConverterTest.cs (1)
115var json = JsonSerializer.Serialize((IJSStreamReference)jsObjectRef, JsonSerializerOptions);
Microsoft.Maui (2)
Handlers\HybridWebView\HybridWebViewHandler.cs (2)
188 Result = JsonSerializer.Serialize(result), 205 contentBytes = System.Text.Encoding.UTF8.GetBytes(JsonSerializer.Serialize(dotNetInvokeResult));
Microsoft.ML.AutoML (4)
AutoMLExperiment\AutoMLExperiment.cs (4)
272logger.Trace($"trial setting - {JsonSerializer.Serialize(trialSettings)}"); 299Exception thrown during Trial {trialSettings.TrialId} with configuration {JsonSerializer.Serialize(trialSettings)} 320logger.Trace($"trial fatal error - {JsonSerializer.Serialize(trialSettings)}, stop training"); 332logger.Trace($"trial cancelled - {JsonSerializer.Serialize(trialSettings)}, stop training");
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 (16)
AutoFeaturizerTests.cs (6)
50Approvals.Verify(JsonSerializer.Serialize(pipeline, _jsonSerializerOptions)); 62Approvals.Verify(JsonSerializer.Serialize(pipeline, _jsonSerializerOptions)); 74Approvals.Verify(JsonSerializer.Serialize(pipeline, _jsonSerializerOptions)); 86Approvals.Verify(JsonSerializer.Serialize(pipeline, _jsonSerializerOptions)); 97Approvals.Verify(JsonSerializer.Serialize(pipeline, _jsonSerializerOptions)); 113Approvals.Verify(JsonSerializer.Serialize(pipeline, _jsonSerializerOptions));
SweepableExtensionTest.cs (9)
84var json = JsonSerializer.Serialize(pipeline, _jsonSerializerOptions); 97var json = JsonSerializer.Serialize(pipeline, _jsonSerializerOptions); 110var json = JsonSerializer.Serialize(pipeline, _jsonSerializerOptions); 123var json = JsonSerializer.Serialize(pipeline, _jsonSerializerOptions); 137var json = JsonSerializer.Serialize(pipeline, _jsonSerializerOptions); 151var json = JsonSerializer.Serialize(pipeline, _jsonSerializerOptions); 164var json = JsonSerializer.Serialize(pipeline, _jsonSerializerOptions); 177var json = JsonSerializer.Serialize(pipeline, _jsonSerializerOptions); 192var json = JsonSerializer.Serialize(pipeline, _jsonSerializerOptions);
SweepablePipelineTests.cs (1)
70Approvals.Verify(JsonSerializer.Serialize(pipeline, _jsonSerializerOptions));
Microsoft.ML.GenAI.Mistral (4)
Mistral_7B_0_3ChatTemplateBuilder.cs (3)
77var schemaPrompt = JsonSerializer.Serialize(schemas); 130var toolCallJson = JsonSerializer.Serialize(toolCallObjects); 152var toolCallResultJson = JsonSerializer.Serialize(toolCallResultObjects);
MistralCausalLMAgent.cs (1)
151.Select(tc => new ToolCall(tc.Name!, JsonSerializer.Serialize(tc.Arguments)) { ToolCallId = this.GenerateToolCallId() });
Microsoft.ML.GenAI.Phi.Tests (1)
Phi3Tests.cs (1)
109var json = JsonSerializer.Serialize(sizeInMB, new JsonSerializerOptions { WriteIndented = true });
Microsoft.ML.SearchSpace (7)
Converter\SearchSpaceConverter.cs (1)
25JsonSerializer.Serialize<IDictionary<string, OptionBase>>(value, options);
Parameter.cs (5)
297var json = JsonSerializer.Serialize(_value, _settings); 393var thisJson = JsonSerializer.Serialize(this); 394var otherJson = JsonSerializer.Serialize(other); 402var thisJson = JsonSerializer.Serialize(this); 426return JsonSerializer.Serialize(this);
SearchSpace.cs (1)
157var json = JsonSerializer.Serialize(parameter);
Microsoft.ML.SearchSpace.Tests (4)
ParameterTest.cs (3)
40var json = JsonSerializer.Serialize(parameter, _settings); 109var json = JsonSerializer.Serialize(parameter, _settings); 119json = JsonSerializer.Serialize(parameter, _settings);
SearchSpaceTest.cs (1)
303var json = JsonSerializer.Serialize(ss, _settings);
Microsoft.ML.Tokenizers.Tests (1)
BpeTests.cs (1)
546File.WriteAllText(fileName, JsonSerializer.Serialize<Dictionary<string, int>>(dic), Encoding.UTF8);
TestProject.AppHost (1)
TestProgram.cs (1)
173await Console.Out.WriteLineAsync("$ENDPOINTS: " + JsonSerializer.Serialize(root, JsonSerializerOptions.Default));
Wasm.Performance.Driver (1)
Program.cs (1)
255builder.AppendLine(JsonSerializer.Serialize(output));