225 writes to Category
Aspire.Hosting.CodeGeneration.Go.Tests (24)
AtsGoDerivedBuilderTests.cs (10)
489private static readonly AtsTypeRef s_builder = new() { TypeId = AtsConstants.BuilderTypeId, Category = AtsTypeCategory.Handle, IsInterface = true }; 496private static readonly AtsTypeRef s_string = new() { TypeId = AtsConstants.String, Category = AtsTypeCategory.Primitive }; 497private static readonly AtsTypeRef s_poolSettings = new() { TypeId = PoolSettingsId, Category = AtsTypeCategory.Dto }; 614private static AtsTypeRef Handle(string typeId) => new() { TypeId = typeId, Category = AtsTypeCategory.Handle }; 619Category = AtsTypeCategory.Array, 627Category = AtsTypeCategory.List, 634Category = AtsTypeCategory.Dict, 643Category = AtsTypeCategory.Union, 654Type = new AtsTypeRef { TypeId = "callback", Category = AtsTypeCategory.Callback }, 657CallbackReturnType = new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive }
GoDocCommentTests.cs (6)
361var resourceType = new AtsTypeRef { TypeId = ResourceTypeId, Category = AtsTypeCategory.Handle }; 362var settingsType = new AtsTypeRef { TypeId = SettingsTypeId, Category = AtsTypeCategory.Dto }; 363var statusType = new AtsTypeRef { TypeId = StatusTypeId, Category = AtsTypeCategory.Enum }; 364var tagsType = new AtsTypeRef { TypeId = "Tests/List<string>", Category = AtsTypeCategory.List, ElementType = stringType }; 475private static AtsTypeRef Primitive(string typeId) => new() { TypeId = typeId, Category = AtsTypeCategory.Primitive }; 496var resourceType = new AtsTypeRef { TypeId = ResourceTypeId, Category = AtsTypeCategory.Handle };
GoGeneratorEscapingTests.cs (8)
95var tagsType = new AtsTypeRef { TypeId = "Tests/List<string>", Category = AtsTypeCategory.List, ElementType = stringType }; 96var unionType = new AtsTypeRef { TypeId = "Tests/Union", Category = AtsTypeCategory.Union, UnionTypes = [stringType, numberType] }; 97var callbackType = new AtsTypeRef { TypeId = "Tests/Callback", Category = AtsTypeCategory.Callback }; 98var enumType = new AtsTypeRef { TypeId = StatusTypeId, Category = AtsTypeCategory.Enum }; 99var lookupType = new AtsTypeRef { TypeId = "Tests/Dict<string,string>", Category = AtsTypeCategory.Dict, KeyType = stringType, ValueType = stringType, IsReadOnly = true }; 100var unknownType = new AtsTypeRef { TypeId = "Tests/Unknown", Category = AtsTypeCategory.Unknown }; 197private static AtsTypeRef Primitive(string typeId) => new() { TypeId = typeId, Category = AtsTypeCategory.Primitive }; 199private static AtsTypeRef Handle(string typeId) => new() { TypeId = typeId, Category = AtsTypeCategory.Handle };
Aspire.Hosting.CodeGeneration.Java.Tests (44)
AtsJavaCodeGeneratorTests.cs (44)
2698new AtsTypeRef { TypeId = "array", Category = AtsTypeCategory.Array, ElementType = MutableStringDict() }); 2714Category = AtsTypeCategory.List, 2728var stringType = new AtsTypeRef { TypeId = "string", Category = AtsTypeCategory.Primitive }; 2729var innerArray = new AtsTypeRef { TypeId = "array", Category = AtsTypeCategory.Array, ElementType = stringType }; 2732new AtsTypeRef { TypeId = "array", Category = AtsTypeCategory.Array, ElementType = innerArray }); 2775var resourceType = new AtsTypeRef { TypeId = "Tests/ProbeResource", Category = AtsTypeCategory.Handle }; 2776var stringType = new AtsTypeRef { TypeId = AtsConstants.String, Category = AtsTypeCategory.Primitive }; 2777var innerArray = new AtsTypeRef { TypeId = "array", Category = AtsTypeCategory.Array, ElementType = stringType }; 2778var matrixType = new AtsTypeRef { TypeId = "array", Category = AtsTypeCategory.Array, ElementType = innerArray }; 2783Type = new AtsTypeRef { TypeId = "callback", Category = AtsTypeCategory.Callback }, 2785CallbackReturnType = new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive } 2792ReturnType = new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive }, 2813var resourceType = new AtsTypeRef { TypeId = "Tests/ProbeResource", Category = AtsTypeCategory.Handle }; 2817Type = new AtsTypeRef { TypeId = AtsConstants.CancellationToken, Category = AtsTypeCategory.Dto } 2824ReturnType = new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive }, 2841var resourceType = new AtsTypeRef { TypeId = "Tests/ProbeResource", Category = AtsTypeCategory.Handle }; 2860Category = AtsTypeCategory.Primitive, 2888Category = AtsTypeCategory.Handle 2895new AtsTypeRef { TypeId = AtsConstants.Boolean, Category = AtsTypeCategory.Primitive, IsNullable = true }), 2899new AtsTypeRef { TypeId = AtsConstants.Number, Category = AtsTypeCategory.Primitive, IsNullable = true }), 3025var resourceType = new AtsTypeRef { TypeId = "Tests/ProbeResource", Category = AtsTypeCategory.Handle }; 3029Category = AtsTypeCategory.Primitive, 3035Category = AtsTypeCategory.Primitive, 3041Category = AtsTypeCategory.Array, 3047Category = AtsTypeCategory.Array, 3053Category = AtsTypeCategory.Array, 3060Type = new AtsTypeRef { TypeId = "callback", Category = AtsTypeCategory.Callback }, 3066CallbackReturnType = new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive } 3073ReturnType = new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive }, 3315var contextType = new AtsTypeRef { TypeId = "Tests/MutableContext", Category = AtsTypeCategory.Dto }; 3331Type = new AtsTypeRef { TypeId = AtsConstants.String, Category = AtsTypeCategory.Primitive } 3344Type = new AtsTypeRef { TypeId = "callback", Category = AtsTypeCategory.Callback }, 3353Category = AtsTypeCategory.Primitive 3406var resourceType = new AtsTypeRef { TypeId = "Tests/ProbeResource", Category = AtsTypeCategory.Handle }; 3407var contextType = new AtsTypeRef { TypeId = "Tests/MutableContext", Category = AtsTypeCategory.Dto }; 3412Type = new AtsTypeRef { TypeId = "callback", Category = AtsTypeCategory.Callback }, 3417CallbackReturnType = new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive } 3424ReturnType = new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive }, 3446Type = new AtsTypeRef { TypeId = AtsConstants.String, Category = AtsTypeCategory.Primitive } 3633Type = new AtsTypeRef { TypeId = "KeywordProbe", Category = AtsTypeCategory.Dto } 3692new AtsTypeRef { TypeId = "string", Category = AtsTypeCategory.Primitive }); 3724Category = AtsTypeCategory.Dict, 3726KeyType = new AtsTypeRef { TypeId = "string", Category = AtsTypeCategory.Primitive }, 3727ValueType = new AtsTypeRef { TypeId = "string", Category = AtsTypeCategory.Primitive }
Aspire.Hosting.CodeGeneration.Python.Tests (20)
AtsPythonCodeGeneratorTests.cs (20)
393Category = AtsTypeCategory.Dto 870Category = AtsTypeCategory.Handle 894Category = AtsTypeCategory.Primitive 926Category = AtsTypeCategory.Handle 950Category = AtsTypeCategory.Primitive 985Category = AtsTypeCategory.Handle 992Category = AtsTypeCategory.Handle, 1000Category = AtsTypeCategory.Handle, 1024Category = AtsTypeCategory.Primitive 1064Category = AtsTypeCategory.Union, 1070Category = AtsTypeCategory.Union, 1076Category = AtsTypeCategory.Primitive, 1084Category = AtsTypeCategory.Primitive 1119Category = AtsTypeCategory.Array, 1123Category = AtsTypeCategory.Primitive, 1133Category = AtsTypeCategory.Primitive 1169Category = AtsTypeCategory.Primitive 1175Category = AtsTypeCategory.Primitive 1182Category = AtsTypeCategory.Handle 1189Category = AtsTypeCategory.Handle
Aspire.Hosting.CodeGeneration.TypeScript.Tests (30)
AtsTypeScriptCodeGeneratorTests.cs (30)
284Category = AtsTypeCategory.Handle 289Category = AtsTypeCategory.Primitive 952Category = AtsTypeCategory.Primitive, 958Category = AtsTypeCategory.Array, 1009Category = AtsTypeCategory.Union, 1025Category = AtsTypeCategory.Primitive 1030Category = AtsTypeCategory.List, 1036Category = AtsTypeCategory.Dict, 1052Category = AtsTypeCategory.Primitive, 1058Category = AtsTypeCategory.Dict, 1059KeyType = new AtsTypeRef { TypeId = AtsConstants.String, Category = AtsTypeCategory.Primitive }, 1063Category = AtsTypeCategory.List, 1736Category = AtsTypeCategory.Handle 1997Category = AtsTypeCategory.Handle 2009Category = AtsTypeCategory.Primitive 2034Category = AtsTypeCategory.Primitive 3017Category = AtsTypeCategory.Handle 3022Category = AtsTypeCategory.Primitive 3027Category = AtsTypeCategory.Primitive 3222Category = AtsTypeCategory.Handle 3230Category = AtsTypeCategory.Handle 3316Category = AtsTypeCategory.Handle 3331Category = AtsTypeCategory.Primitive 3434Category = AtsTypeCategory.Handle 3449Category = AtsTypeCategory.Callback 3464Category = AtsTypeCategory.Primitive 3471Category = AtsTypeCategory.Primitive 3498Category = AtsTypeCategory.Primitive 3507Category = AtsTypeCategory.Primitive 3515Category = AtsTypeCategory.Primitive
Aspire.Hosting.Native.CodeGeneration (35)
src\Aspire.Hosting.RemoteHost\AtsCapabilityScanner.cs (35)
770typeRef.Category = AtsTypeCategory.Handle; 930Category = AtsTypeCategory.Handle, 961Category = AtsTypeCategory.Handle, 1171? new AtsTypeRef { TypeId = "callback", ClrType = prop.PropertyType, Category = AtsTypeCategory.Callback } 1691: new AtsTypeRef { TypeId = AtsConstants.Any, Category = AtsTypeCategory.Primitive }; 1696Category = AtsTypeCategory.Dict, 1718propertyTypeRef = new AtsTypeRef { TypeId = AtsConstants.Any, Category = AtsTypeCategory.Primitive }; 2231? new AtsTypeRef { TypeId = "callback", Category = AtsTypeCategory.Callback } 2288returnTypeRef = new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive }; 2292returnTypeRef = new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive }; 2300?? new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive } 2301: new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive }; 2306?? new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive } 2334var voidTypeRef = new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive }; 2670Category = AtsTypeCategory.Primitive 2707Category = typeRef.Category, 2785return new AtsTypeRef { TypeId = primitiveTypeId, ClrType = type, Category = AtsTypeCategory.Primitive }; 2791return new AtsTypeRef { TypeId = AtsConstants.Any, ClrType = type, Category = AtsTypeCategory.Primitive }; 2800Category = AtsTypeCategory.Dict, 2801KeyType = new AtsTypeRef { TypeId = AtsConstants.String, ClrType = typeof(string), Category = AtsTypeCategory.Primitive }, 2802ValueType = new AtsTypeRef { TypeId = AtsConstants.Any, ClrType = typeof(object), Category = AtsTypeCategory.Primitive }, 2813Category = AtsTypeCategory.List, 2814ElementType = new AtsTypeRef { TypeId = AtsConstants.Any, ClrType = typeof(object), Category = AtsTypeCategory.Primitive } 2828Category = AtsTypeCategory.Enum 2851Category = AtsTypeCategory.Dict, 2874Category = AtsTypeCategory.Dict, 2896Category = AtsTypeCategory.List, 2916Category = AtsTypeCategory.Array, 2961Category = AtsTypeCategory.Array, 2977Category = AtsTypeCategory.Dto, 2989Category = AtsTypeCategory.Handle, 2999Category = AtsTypeCategory.Unknown, 3094Category = AtsTypeCategory.Handle, 3161Category = AtsTypeCategory.Handle, 3419Category = AtsTypeCategory.Union,
Aspire.Hosting.RemoteHost (40)
Ats\AtsMarshaller.cs (1)
428Category = _context.GetCategory(type)
Ats\ExternalCapabilityRegistry.cs (2)
796: new AtsTypeRef { TypeId = "unknown", Category = AtsTypeCategory.Unknown } 809Category = typeRef.Category,
AtsCapabilityScanner.cs (35)
770typeRef.Category = AtsTypeCategory.Handle; 930Category = AtsTypeCategory.Handle, 961Category = AtsTypeCategory.Handle, 1171? new AtsTypeRef { TypeId = "callback", ClrType = prop.PropertyType, Category = AtsTypeCategory.Callback } 1691: new AtsTypeRef { TypeId = AtsConstants.Any, Category = AtsTypeCategory.Primitive }; 1696Category = AtsTypeCategory.Dict, 1718propertyTypeRef = new AtsTypeRef { TypeId = AtsConstants.Any, Category = AtsTypeCategory.Primitive }; 2231? new AtsTypeRef { TypeId = "callback", Category = AtsTypeCategory.Callback } 2288returnTypeRef = new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive }; 2292returnTypeRef = new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive }; 2300?? new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive } 2301: new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive }; 2306?? new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive } 2334var voidTypeRef = new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive }; 2670Category = AtsTypeCategory.Primitive 2707Category = typeRef.Category, 2785return new AtsTypeRef { TypeId = primitiveTypeId, ClrType = type, Category = AtsTypeCategory.Primitive }; 2791return new AtsTypeRef { TypeId = AtsConstants.Any, ClrType = type, Category = AtsTypeCategory.Primitive }; 2800Category = AtsTypeCategory.Dict, 2801KeyType = new AtsTypeRef { TypeId = AtsConstants.String, ClrType = typeof(string), Category = AtsTypeCategory.Primitive }, 2802ValueType = new AtsTypeRef { TypeId = AtsConstants.Any, ClrType = typeof(object), Category = AtsTypeCategory.Primitive }, 2813Category = AtsTypeCategory.List, 2814ElementType = new AtsTypeRef { TypeId = AtsConstants.Any, ClrType = typeof(object), Category = AtsTypeCategory.Primitive } 2828Category = AtsTypeCategory.Enum 2851Category = AtsTypeCategory.Dict, 2874Category = AtsTypeCategory.Dict, 2896Category = AtsTypeCategory.List, 2916Category = AtsTypeCategory.Array, 2961Category = AtsTypeCategory.Array, 2977Category = AtsTypeCategory.Dto, 2989Category = AtsTypeCategory.Handle, 2999Category = AtsTypeCategory.Unknown, 3094Category = AtsTypeCategory.Handle, 3161Category = AtsTypeCategory.Handle, 3419Category = AtsTypeCategory.Union,
AtsContextFilter.cs (2)
326Category = AtsTypeCategory.Handle, 345Category = AtsTypeCategory.Primitive
Aspire.Hosting.RemoteHost.Tests (32)
AtsContextFilterTests.cs (17)
192Category = AtsTypeCategory.Dto 199Category = AtsTypeCategory.Handle 206Category = AtsTypeCategory.Handle, 278Category = AtsTypeCategory.Enum 285Type = new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive }, 296Category = AtsTypeCategory.Enum 436Category = AtsTypeCategory.Enum 489Category = AtsTypeCategory.Enum 509Category = AtsTypeCategory.Handle 519Category = AtsTypeCategory.Dto 529Category = AtsTypeCategory.Enum 537Category = AtsTypeCategory.Handle, 545Category = AtsTypeCategory.Handle 562Category = AtsTypeCategory.Handle 580Category = AtsTypeCategory.Primitive 593Category = AtsTypeCategory.Dto 606Category = AtsTypeCategory.Primitive
AtsMarshallerTests.cs (12)
172Category = AtsTypeCategory.Union, 175new AtsTypeRef { TypeId = AtsConstants.String, ClrType = typeof(string), Category = AtsTypeCategory.Primitive }, 176new AtsTypeRef { TypeId = AtsConstants.Number, ClrType = typeof(int), Category = AtsTypeCategory.Primitive }, 177new AtsTypeRef { TypeId = AtsConstants.Boolean, ClrType = typeof(bool), Category = AtsTypeCategory.Primitive } 195Category = AtsTypeCategory.Union, 198new AtsTypeRef { TypeId = AtsConstants.String, ClrType = typeof(string), Category = AtsTypeCategory.Primitive }, 199new AtsTypeRef { TypeId = "test/IResource", ClrType = typeof(IResource), Category = AtsTypeCategory.Handle } 217Category = AtsTypeCategory.Union, 220new AtsTypeRef { TypeId = AtsConstants.String, ClrType = typeof(string), Category = AtsTypeCategory.Primitive }, 221new AtsTypeRef { TypeId = AtsConstants.Boolean, ClrType = typeof(bool), Category = AtsTypeCategory.Primitive } 294Category = AtsTypeCategory.Primitive 1021var typeRef = new AtsTypeRef { TypeId = "test/SelfReferencingDto", Category = AtsTypeCategory.Dto };
ExternalCapabilityRegistryTests.cs (3)
894ReturnType = new AtsTypeRef { TypeId = AtsConstants.Boolean, Category = AtsTypeCategory.Primitive } 920ReturnType = new AtsTypeRef { TypeId = AtsConstants.Boolean, Category = AtsTypeCategory.Primitive } 964Type = new AtsTypeRef { TypeId = AtsConstants.String, Category = AtsTypeCategory.Primitive },
134 references to Category
aspire-managed (1)
AppHostServerV2CodeGeneration.cs (1)
114if (type.Category == AtsTypeCategory.Handle)
Aspire.Hosting.CodeGeneration.Go (19)
AtsGoCodeGenerator.ApiProjection.cs (2)
724var returnsHandle = hasReturn && returnType!.Category == AtsTypeCategory.Handle; 1116if (typeRef.Category == AtsTypeCategory.Handle && typeRef.ClrType is { } clrType)
AtsGoCodeGenerator.cs (16)
452if (typeRef.Category == AtsTypeCategory.Handle) 985var renderedValue = typeRef.Category switch 1003var valueType = typeRef.Category == AtsTypeCategory.Primitive 1241if (capability.ReturnType.Category != AtsTypeCategory.List 1242&& capability.ReturnType.Category != AtsTypeCategory.Dict) 1609if (returnType.Category != AtsTypeCategory.Handle) 1822if (p.Type?.Category != AtsTypeCategory.Handle) { continue; } 2009else if (p.CallbackParameters is { Count: > 0 } callbackParameters && callbackParameters.Any(cp => cp.Type.Category == AtsTypeCategory.Dto)) 2023if (callbackParameters[i].Type.Category == AtsTypeCategory.Dto) 2047&& type.Category == AtsTypeCategory.Handle 2078if (returnType.Category == AtsTypeCategory.Dict) 2284if (p.Type?.Category == AtsTypeCategory.Union) 2388if (hasReturn && capability.ReturnType!.Category == AtsTypeCategory.Handle) 2609var baseType = typeRef.Category switch 2647var baseType = typeRef.Category switch 2675&& typeRef.Category is AtsTypeCategory.Primitive or AtsTypeCategory.Enum
src\Shared\CodeGeneration\AtsOptionsFlattening.cs (1)
54if (candidate.Type?.Category != AtsTypeCategory.Dto)
Aspire.Hosting.CodeGeneration.Java (15)
AtsJavaCodeGenerator.cs (15)
877return typeRef.Category switch 1139if (parameter.IsCallback || parameter.Type?.Category != AtsTypeCategory.Handle) 2061var converted = typeRef.Category switch 2102if (typeRef?.Category is not (AtsTypeCategory.Dict or AtsTypeCategory.Array or AtsTypeCategory.List)) 2109if (typeRef.Category == AtsTypeCategory.List) 2125if (typeRef.Category == AtsTypeCategory.Array) 2251return returnType.Category == AtsTypeCategory.List || returnType.Category == AtsTypeCategory.Dict; 2257var isDict = returnType.Category == AtsTypeCategory.Dict; 2574return typeRef.Category switch 2606return typeRef.Category switch 2680private static bool IsUnionType(AtsTypeRef? typeRef) => typeRef?.Category == AtsTypeCategory.Union; 2703if (typeRef.Category == AtsTypeCategory.Handle) 2716if (typeRef.Category == AtsTypeCategory.List) 2723else if (typeRef.Category == AtsTypeCategory.Dict)
Aspire.Hosting.CodeGeneration.Python (16)
AtsPythonCodeGenerator.cs (16)
158typeRef != null && typeRef.Category == AtsTypeCategory.Handle; 220var mappedType = typeRef.Category switch 246&& typeRef.Category is AtsTypeCategory.Primitive or AtsTypeCategory.Enum 298parameter.CallbackParameters?.Any(p => p.Type.Category == AtsTypeCategory.Dto && p.Type.TypeId != AtsConstants.CancellationToken) == true 526if (typeRef.Category == AtsTypeCategory.Union) 533if (typeRef.Category == AtsTypeCategory.Primitive && typeRef.TypeId == AtsConstants.Void) 603return typeRef.Category switch 1014expression = typeRef.Category switch 1026if (!topLevel || typeRef.Category is AtsTypeCategory.Primitive) 1382var isResourceBuilder = capability.ReturnType != null && capability.ReturnType.Category == AtsTypeCategory.Handle && 1455if (capability.ReturnType != null && (capability.ReturnType.Category == AtsTypeCategory.Handle || capability.ReturnType.Category == AtsTypeCategory.Dto)) 1940if (targetTypeRef.Category != AtsTypeCategory.Handle) 2189if (!string.IsNullOrEmpty(typeRef.TypeId) && typeRef.Category == AtsTypeCategory.Handle) 2193if (!string.IsNullOrEmpty(typeRef.TypeId) && typeRef.Category == AtsTypeCategory.Dict) 2197if (!string.IsNullOrEmpty(typeRef.TypeId) && typeRef.Category == AtsTypeCategory.List)
Aspire.Hosting.CodeGeneration.Rust (19)
AtsRustCodeGenerator.cs (19)
384return typeRef.Category switch 617else if (returnTypeRef?.Category == AtsTypeCategory.Dict && returnTypeRef.IsReadOnly == false) 623else if (returnTypeRef?.Category == AtsTypeCategory.List && returnTypeRef.IsReadOnly == false) 656return returnType.Category == AtsTypeCategory.List || returnType.Category == AtsTypeCategory.Dict; 664var isDict = returnType.Category == AtsTypeCategory.Dict; 912var baseType = typeRef.Category switch 950var baseType = typeRef.Category switch 990var baseType = typeRef.Category switch 1037if (typeRef.Category == AtsTypeCategory.Primitive) 1063&& typeRef.Category is AtsTypeCategory.Primitive or AtsTypeCategory.Enum 1067typeRef?.Category == AtsTypeCategory.Handle 1073&& (typeRef.Category == AtsTypeCategory.Array || (typeRef.Category == AtsTypeCategory.List && typeRef.IsReadOnly)) 1079&& ((typeRef.Category == AtsTypeCategory.List && !typeRef.IsReadOnly) 1080|| (typeRef.Category == AtsTypeCategory.Dict && !typeRef.IsReadOnly)); 1103if (typeRef.Category == AtsTypeCategory.Handle) 1116if (typeRef.Category == AtsTypeCategory.List || typeRef.Category == AtsTypeCategory.Dict)
Aspire.Hosting.CodeGeneration.TypeScript (18)
AtsTypeScriptCodeGenerator.cs (2)
387if (typeRef?.Category != AtsTypeCategory.Dto || 402if (typeRef?.Category != AtsTypeCategory.Dto ||
src\Shared\CodeGeneration\AtsOptionsFlattening.cs (1)
54if (candidate.Type?.Category != AtsTypeCategory.Dto)
TypeScriptApiProjector.cs (15)
759return exportedValue.Type.Category is AtsTypeCategory.Primitive 771return typeRef.Category switch 1648typeRef is { Category: AtsTypeCategory.Handle }; 1689var mappedType = typeRef.Category switch 1710if (typeRef.IsNullable != true || typeRef.Category is not (AtsTypeCategory.Primitive or AtsTypeCategory.Enum)) 1727return typeRef.Category switch 1738var requiresGrouping = elementType?.Category == AtsTypeCategory.Union || 1739elementType is { IsNullable: true, Category: AtsTypeCategory.Primitive or AtsTypeCategory.Enum }; 1859if (typeRef?.Category == AtsTypeCategory.Union) 2008return typeRef.Category == AtsTypeCategory.Handle && typeRef.IsInterface; 2551if (typeRef.Category == AtsTypeCategory.Union && typeRef.UnionTypes is { Count: > 0 }) 2625return typeRef?.Category == AtsTypeCategory.Dict; 2634return typeRef?.Category == AtsTypeCategory.List; 2667if (targetTypeRef.Category != AtsTypeCategory.Handle) 2942if (!string.IsNullOrEmpty(typeRef.TypeId) && typeRef.Category == AtsTypeCategory.Handle)
Aspire.Hosting.CodeGeneration.TypeScript.Tests (7)
AtsTypeScriptCodeGeneratorTests.cs (7)
916Assert.Equal(AtsTypeCategory.Handle, dependencyParam.Type.Category); 1284Assert.Equal(AtsTypeCategory.Dto, addNodePool.Parameters[^1].CallbackParameters![0].Type.Category); 1285Assert.Equal(AtsTypeCategory.Dto, withSystemNodePool.Parameters[^1].CallbackParameters![0].Type.Category); 2411Assert.Equal(AtsTypeCategory.Primitive, ctParam.Type.Category); 2507Assert.Equal(AtsTypeCategory.Dto, options.Type.Category); 2523Assert.Equal(AtsTypeCategory.Handle, legacyOptions.Type.Category); 2664Assert.NotEqual(AtsTypeCategory.Unknown, param.Type.Category);
Aspire.Hosting.Native.CodeGeneration (19)
NativeCSharpProjection.cs (7)
115if (callback.CallbackParameters is not [{ Type.Category: AtsTypeCategory.Handle }] || 160var value = parameter.Type!.Category == AtsTypeCategory.Union 165: parameter.Type.Category == AtsTypeCategory.Handle 193if (capability.ReturnType.Category == AtsTypeCategory.Handle) 235var name = type.Category switch 251_ => throw new NotSupportedException($"Unsupported native C# type: {type.TypeId} ({type.Category}).") 258private static bool ContainsHandle(AtsTypeRef type) => type.Category == AtsTypeCategory.Handle ||
NativeProviderTypeScriptProjection.cs (3)
26.Append(method.ReturnType)).OfType<AtsTypeRef>().Where(type => type.Category == AtsTypeCategory.Handle) 90return type.Category switch 101_ => throw new NotSupportedException($"Unsupported provider type category '{type.Category}'.")
Program.cs (4)
433if (parameter.IsCallback && parameter.CallbackParameters is [{ Type.Category: AtsTypeCategory.Handle } callbackParameter] && 439if (parameter.Type is { Category: AtsTypeCategory.Union, UnionTypes: { } members } && 441members.All(member => member.TypeId == "string" || member.Category == AtsTypeCategory.Handle)) 443return $"RpcArguments.Union({node}, handles, [{string.Join(", ", members.Where(member => member.Category == AtsTypeCategory.Handle).Select(member => Literal(member.TypeId)))}])";
src\Aspire.Hosting.RemoteHost\AtsCapabilityScanner.cs (5)
684if (typeRef.Category == AtsTypeCategory.Enum && typeRef.ClrType != null) 768if (typeRef.Category == AtsTypeCategory.Unknown && validTypes.Contains(typeRef.TypeId)) 863if (typeRef.Category == AtsTypeCategory.Unknown) 1384return typeRef.Category switch 2707Category = typeRef.Category,
Aspire.Hosting.RemoteHost (9)
Ats\AtsMarshaller.cs (2)
155return typeRef.Category switch 165_ => throw new InvalidOperationException($"Unknown type category: {typeRef.Category}")
AtsCapabilityScanner.cs (5)
684if (typeRef.Category == AtsTypeCategory.Enum && typeRef.ClrType != null) 768if (typeRef.Category == AtsTypeCategory.Unknown && validTypes.Contains(typeRef.TypeId)) 863if (typeRef.Category == AtsTypeCategory.Unknown) 1384return typeRef.Category switch 2707Category = typeRef.Category,
AtsContextFilter.cs (1)
394if (typeRef.Category == AtsTypeCategory.Handle && !string.IsNullOrEmpty(typeRef.TypeId))
CodeGeneration\CodeGenerationService.cs (1)
151Category = t.Category.ToString(),
Aspire.Hosting.RemoteHost.Tests (11)
AtsCapabilityScannerTests.cs (11)
161Assert.Equal(AtsTypeCategory.Array, itemsType.Category); 166Assert.Equal(AtsTypeCategory.Array, enumerableReturnCapability.ReturnType.Category); 177Assert.Equal(AtsTypeCategory.Array, typeRef.Category); 192Assert.Equal(AtsTypeCategory.Union, parameter.Type?.Category); 336Assert.Equal(AtsTypeCategory.Union, resourceParameter.Type?.Category); 342Assert.Equal(AtsTypeCategory.Dict, argumentsParameter.Type?.Category); 425Assert.Equal(AtsTypeCategory.Dto, optionsParameter.Type.Category); 442Assert.Equal(AtsTypeCategory.Handle, callbackParameter.Type.Category); 444Assert.Equal(AtsTypeCategory.Dto, prepareRequestProperty.CallbackReturnType?.Category); 664Assert.NotEqual(AtsTypeCategory.Unknown, cbParam.Type.Category); 683Assert.Equal(AtsTypeCategory.Handle, parameter.Type.Category);