96 references to Create
aspire (14)
Agents\Hooks\TelemetryHookConfigurator.cs (2)
148["args"] = new JsonArray(args.Select(arg => (JsonNode?)JsonValue.Create(arg)).ToArray()), 265["args"] = new JsonArray(args.Select(arg => (JsonNode?)JsonValue.Create(arg)).ToArray()),
Mcp\Tools\ExecuteResourceCommandTool.cs (4)
188JsonValueKind.String => JsonValue.Create(property.Value.GetString()), 189JsonValueKind.Number => JsonValue.Create(property.Value.GetRawText()), 190JsonValueKind.True => JsonValue.Create("true"), 191JsonValueKind.False => JsonValue.Create("false"),
Migrations\TypeScriptAppHostMigration.cs (2)
260rewritten.Add((JsonNode?)JsonValue.Create(LegacyTypeScriptAppHost.RewriteTsConfigIncludeEntry(value.GetValue<string>()))); 303scripts[script.Key] = (JsonNode?)JsonValue.Create(rewritten);
Projects\FallbackProjectParser.cs (5)
131packageObj["Identity"] = JsonValue.Create(pkg.Identity); 132packageObj["Version"] = JsonValue.Create(pkg.Version); 142projectObj["Identity"] = JsonValue.Create(proj.Identity); 143projectObj["FullPath"] = JsonValue.Create(proj.FullPath); 152propertiesObject["AspireHostingSDKVersion"] = JsonValue.Create(aspireHostingSdkVersion);
src\Shared\Json\AtsJsonCodeWriter.cs (1)
33return JsonValue.Create(value)!.ToJsonString(s_relaxedJsonOptions);
Aspire.Cli.Tests (21)
Backchannel\ResourceSnapshotMapperTests.cs (2)
344["custom.list"] = new JsonArray((JsonNode?)JsonValue.Create("one"), (JsonNode?)JsonValue.Create("two"))
Commands\SdkDumpCommandTests.cs (1)
435Value = JsonValue.Create("你好"),
Mcp\ExcludeFromMcpTests.cs (1)
76[KnownProperties.Resource.ExcludeFromMcp] = JsonValue.Create("true")
Mcp\ListResourcesToolTests.cs (17)
731[KnownProperties.Project.Path] = JsonValue.Create(@"C:\repo\Api\Api.csproj") 741[KnownProperties.Executable.Path] = JsonValue.Create(@"C:\repo\bin\worker.exe") 769[KnownProperties.Resource.Source] = JsonValue.Create(string.Empty), 770[KnownProperties.Project.Path] = JsonValue.Create("/repo/Project/Project.csproj") 780[KnownProperties.Resource.Source] = JsonValue.Create(string.Empty), 781[KnownProperties.Executable.Path] = JsonValue.Create("/repo/bin/worker") 791[KnownProperties.Resource.Source] = JsonValue.Create(string.Empty), 792[KnownProperties.Container.Image] = JsonValue.Create("redis:8") 820[KnownProperties.Container.Image] = JsonValue.Create(sourceValue) 893[KnownProperties.Project.Path] = JsonValue.Create("/repo/Api/Api.csproj"), 894["secret.property"] = JsonValue.Create("property-secret") 971[KnownProperties.Container.Image] = JsonValue.Create("redis:8"), 972[KnownProperties.Executable.Path] = JsonValue.Create("/repo/bin/container-secret") 982[KnownProperties.Executable.Path] = JsonValue.Create("/repo/bin/worker") 992[KnownProperties.Resource.Source] = JsonValue.Create("generic-source-secret") 1002[KnownProperties.Project.Path] = JsonValue.Create("/repo/CaseMismatched/CaseMismatched.csproj"), 1003[KnownProperties.Resource.Source] = JsonValue.Create("case-mismatch-secret")
Aspire.Dashboard (3)
Model\TelemetryExportService.cs (1)
792return JsonValue.Create(stringValue);
Otlp\Model\OtlpHelpers.cs (2)
201AnyValue.ValueOneofCase.StringValue => JsonValue.Create(value.StringValue), 205AnyValue.ValueOneofCase.BytesValue => JsonValue.Create(value.BytesValue.ToHexString()),
Aspire.Dashboard.Tests (2)
Model\GenAIItemPartViewModelTests.cs (2)
20Response = JsonValue.Create("**Markdown**") 39Response = JsonValue.Create(expectedText)
Aspire.Hosting (4)
Backchannel\AuxiliaryBackchannelRpcTarget.cs (3)
1414string stringValue => JsonValue.Create(stringValue), 1429_ => JsonValue.Create(value.ToString()) 1448return stringValue is null ? null : JsonValue.Create(stringValue);
Pipelines\DeploymentStateSection.cs (1)
56Data[RootValueKey] = JsonValue.Create(value);
Aspire.Hosting.Azure (2)
AzureProvisioningController.cs (1)
2451deletedResourceIds.Add(JsonValue.Create(resourceId));
Provisioning\BicepUtilities.cs (1)
59IEnumerable<string> s => new JsonArray(s.Select(s => JsonValue.Create(s)).ToArray()),
Aspire.Hosting.Azure.Sandboxes (1)
AzureSandboxContainerDeployment.cs (1)
1957.Select(static ownerId => JsonValue.Create(ownerId))
Aspire.Hosting.CodeGeneration.Go (1)
src\Shared\Json\AtsJsonCodeWriter.cs (1)
33return JsonValue.Create(value)!.ToJsonString(s_relaxedJsonOptions);
Aspire.Hosting.CodeGeneration.Java (1)
src\Shared\Json\AtsJsonCodeWriter.cs (1)
33return JsonValue.Create(value)!.ToJsonString(s_relaxedJsonOptions);
Aspire.Hosting.CodeGeneration.Python (2)
AtsPythonCodeGenerator.cs (1)
305? JsonValue.Create(callbackParameter.Type.TypeId)!.ToJsonString()
src\Shared\Json\AtsJsonCodeWriter.cs (1)
33return JsonValue.Create(value)!.ToJsonString(s_relaxedJsonOptions);
Aspire.Hosting.CodeGeneration.Rust (1)
src\Shared\Json\AtsJsonCodeWriter.cs (1)
33return JsonValue.Create(value)!.ToJsonString(s_relaxedJsonOptions);
Aspire.Hosting.CodeGeneration.TypeScript (2)
src\Shared\Json\AtsJsonCodeWriter.cs (1)
33return JsonValue.Create(value)!.ToJsonString(s_relaxedJsonOptions);
TypeScriptApiExportWriter.cs (1)
199array.Add((JsonNode)JsonValue.Create(value));
Aspire.Hosting.RemoteHost (6)
Ats\AtsMarshaller.cs (6)
159AtsTypeCategory.Enum => JsonValue.Create(value.ToString()), 217AtsTypeCategory.Enum => JsonValue.Create(value.ToString()), 240return JsonValue.Create(((DateOnly)value).ToString("O", System.Globalization.CultureInfo.InvariantCulture)); 246return JsonValue.Create(((TimeOnly)value).ToString("O", System.Globalization.CultureInfo.InvariantCulture)); 456AtsTypeCategory.Enum => JsonValue.Create(value.ToString()), 484return JsonValue.Create(tokenId);
Aspire.Hosting.RemoteHost.Tests (27)
AtsContextFilterTests.cs (2)
582Value = JsonValue.Create("selected") 608Value = JsonValue.Create("unrelated")
AtsMarshallerTests.cs (7)
309var value = JsonValue.Create("test"); 535var value = JsonValue.Create("2024-06-15"); 558var value = JsonValue.Create("14:30:45"); 731var value = JsonValue.Create("01:30:00"); 918var json = JsonValue.Create("ValueB"); 929var json = JsonValue.Create("valueb"); // lowercase 951var json = JsonValue.Create("ValueA");
CallbackProxyTests.cs (2)
220var invoker = new TestCallbackInvoker { ResultToReturn = JsonValue.Create("result-value") }; 371["p0"] = JsonValue.Create("some-string"),
CapabilityDispatcherTests.cs (2)
18CapabilityHandler handler = (args, handles) => Task.FromResult<JsonNode?>(JsonValue.Create("result")); 54return Task.FromResult<JsonNode?>(JsonValue.Create("success"));
ExternalCapabilityRegistryTests.cs (9)
109(_, _) => Task.FromResult<JsonNode?>(JsonValue.Create("configured"))); 194return Task.FromResult<JsonNode?>(JsonValue.Create($"deferred-{args!["p0"]!.GetValue<string>()}")); 321response.SetResult(JsonValue.Create("completed")); 496(_, _) => Task.FromResult<JsonNode?>(JsonValue.Create("original"))); 498(_, _) => Task.FromResult<JsonNode?>(JsonValue.Create("other"))); 500(_, _) => Task.FromResult<JsonNode?>(JsonValue.Create("replacement"))); 604(_, _) => Task.FromResult<JsonNode?>(JsonValue.Create("first-replacement"))); 606(_, _) => Task.FromResult<JsonNode?>(JsonValue.Create("second-replacement"))); 965Value = JsonValue.Create("managed-value")
HandleRegistryTests.cs (2)
262var json = JsonValue.Create("not an object"); 321var json = JsonValue.Create("string");
JsonRpcCallbackInvokerTests.cs (1)
70return JsonValue.Create("responsive");
ReferenceExpressionRefTests.cs (2)
175JsonValue.Create("6379") 198JsonValue.Create("6379")
Aspire.Hosting.Tests (2)
Dcp\JsonPatchTests.cs (2)
30var current = JsonValue.Create("before"); 31var changed = JsonValue.Create("after");
dotnet-user-jwts (1)
Helpers\JwtAuthenticationSchemeSettings.cs (1)
24[nameof(TokenValidationParameters.ValidAudiences)] = new JsonArray(Audiences.Select(aud => JsonValue.Create(aud)).ToArray()),
Microsoft.AspNetCore.OpenApi (2)
Services\OpenApiDocumentService.cs (2)
550eventSchema.Enum = [.. mapping.Keys.Select(static eventName => JsonValue.Create(eventName)!)]; 559.Select(static schemaReference => JsonValue.Create(schemaReference.Reference.Id)!)
Microsoft.NET.Build.Containers (1)
ImageConfig.cs (1)
168static JsonArray ToJsonArray(IEnumerable<string> items) => new(items.Where(s => !string.IsNullOrEmpty(s)).Select(s => JsonValue.Create(s)).ToArray<JsonNode?>());
Microsoft.NET.Build.Tasks (1)
GenerateRuntimeConfigurationFiles.cs (1)
346return JsonValue.Create(valueString);
Microsoft.TemplateEngine.Cli (1)
Alias\AliasRegistry.cs (1)
156arr.Add((JsonNode)JsonValue.Create(item)!);
System.Text.Json (1)
System\Text\Json\Nodes\JsonNode.Operators.cs (1)
200public static implicit operator JsonNode?(string? value) => JsonValue.Create(value);