233 writes to Category
Aspire.Hosting.CodeGeneration.Go.Tests (30)
AtsGoCodeGeneratorTests.cs (4)
2640Category = AtsTypeCategory.Primitive 2646Category = AtsTypeCategory.Primitive 2648var voidType = new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive }; 2736Category = AtsTypeCategory.Primitive
AtsGoDerivedBuilderTests.cs (10)
490private static readonly AtsTypeRef s_builder = new() { TypeId = AtsConstants.BuilderTypeId, Category = AtsTypeCategory.Handle, IsInterface = true }; 497private static readonly AtsTypeRef s_string = new() { TypeId = AtsConstants.String, Category = AtsTypeCategory.Primitive }; 498private static readonly AtsTypeRef s_poolSettings = new() { TypeId = PoolSettingsId, Category = AtsTypeCategory.Dto }; 615private static AtsTypeRef Handle(string typeId) => new() { TypeId = typeId, Category = AtsTypeCategory.Handle }; 620Category = AtsTypeCategory.Array, 628Category = AtsTypeCategory.List, 635Category = AtsTypeCategory.Dict, 644Category = AtsTypeCategory.Union, 655Type = new AtsTypeRef { TypeId = "callback", Category = AtsTypeCategory.Callback }, 658CallbackReturnType = new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive }
GoApiExportTests.cs (2)
334new AtsDtoPropertyInfo { Name = "Required", Type = new AtsTypeRef { TypeId = "string", Category = AtsTypeCategory.Primitive } }, 335new AtsDtoPropertyInfo { Name = "Optional", Type = new AtsTypeRef { TypeId = "string", Category = AtsTypeCategory.Primitive }, IsOptional = true }
GoDocCommentTests.cs (6)
451var resourceType = new AtsTypeRef { TypeId = ResourceTypeId, Category = AtsTypeCategory.Handle }; 452var settingsType = new AtsTypeRef { TypeId = SettingsTypeId, Category = AtsTypeCategory.Dto }; 453var statusType = new AtsTypeRef { TypeId = StatusTypeId, Category = AtsTypeCategory.Enum }; 454var tagsType = new AtsTypeRef { TypeId = "Tests/List<string>", Category = AtsTypeCategory.List, ElementType = stringType }; 565private static AtsTypeRef Primitive(string typeId) => new() { TypeId = typeId, Category = AtsTypeCategory.Primitive }; 586var resourceType = new AtsTypeRef { TypeId = ResourceTypeId, Category = AtsTypeCategory.Handle };
GoGeneratorEscapingTests.cs (8)
119var tagsType = new AtsTypeRef { TypeId = "Tests/List<string>", Category = AtsTypeCategory.List, ElementType = stringType }; 120var unionType = new AtsTypeRef { TypeId = "Tests/Union", Category = AtsTypeCategory.Union, UnionTypes = [stringType, numberType] }; 121var callbackType = new AtsTypeRef { TypeId = "Tests/Callback", Category = AtsTypeCategory.Callback }; 122var enumType = new AtsTypeRef { TypeId = StatusTypeId, Category = AtsTypeCategory.Enum }; 123var lookupType = new AtsTypeRef { TypeId = "Tests/Dict<string,string>", Category = AtsTypeCategory.Dict, KeyType = stringType, ValueType = stringType, IsReadOnly = true }; 124var unknownType = new AtsTypeRef { TypeId = "Tests/Unknown", Category = AtsTypeCategory.Unknown }; 223private static AtsTypeRef Primitive(string typeId) => new() { TypeId = typeId, Category = AtsTypeCategory.Primitive }; 225private static AtsTypeRef Handle(string typeId) => new() { TypeId = typeId, Category = AtsTypeCategory.Handle };
Aspire.Hosting.CodeGeneration.Java.Tests (46)
AtsJavaCodeGeneratorTests.cs (46)
719var numberType = new AtsTypeRef { TypeId = AtsConstants.Number, Category = AtsTypeCategory.Primitive }; 720var booleanType = new AtsTypeRef { TypeId = AtsConstants.Boolean, Category = AtsTypeCategory.Primitive }; 2920new AtsTypeRef { TypeId = "array", Category = AtsTypeCategory.Array, ElementType = MutableStringDict() }); 2936Category = AtsTypeCategory.List, 2950var stringType = new AtsTypeRef { TypeId = "string", Category = AtsTypeCategory.Primitive }; 2951var innerArray = new AtsTypeRef { TypeId = "array", Category = AtsTypeCategory.Array, ElementType = stringType }; 2954new AtsTypeRef { TypeId = "array", Category = AtsTypeCategory.Array, ElementType = innerArray }); 2997var resourceType = new AtsTypeRef { TypeId = "Tests/ProbeResource", Category = AtsTypeCategory.Handle }; 2998var stringType = new AtsTypeRef { TypeId = AtsConstants.String, Category = AtsTypeCategory.Primitive }; 2999var innerArray = new AtsTypeRef { TypeId = "array", Category = AtsTypeCategory.Array, ElementType = stringType }; 3000var matrixType = new AtsTypeRef { TypeId = "array", Category = AtsTypeCategory.Array, ElementType = innerArray }; 3005Type = new AtsTypeRef { TypeId = "callback", Category = AtsTypeCategory.Callback }, 3007CallbackReturnType = new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive } 3014ReturnType = new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive }, 3035var resourceType = new AtsTypeRef { TypeId = "Tests/ProbeResource", Category = AtsTypeCategory.Handle }; 3039Type = new AtsTypeRef { TypeId = AtsConstants.CancellationToken, Category = AtsTypeCategory.Dto } 3046ReturnType = new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive }, 3063var resourceType = new AtsTypeRef { TypeId = "Tests/ProbeResource", Category = AtsTypeCategory.Handle }; 3082Category = AtsTypeCategory.Primitive, 3110Category = AtsTypeCategory.Handle 3117new AtsTypeRef { TypeId = AtsConstants.Boolean, Category = AtsTypeCategory.Primitive, IsNullable = true }), 3121new AtsTypeRef { TypeId = AtsConstants.Number, Category = AtsTypeCategory.Primitive, IsNullable = true }), 3247var resourceType = new AtsTypeRef { TypeId = "Tests/ProbeResource", Category = AtsTypeCategory.Handle }; 3251Category = AtsTypeCategory.Primitive, 3257Category = AtsTypeCategory.Primitive, 3263Category = AtsTypeCategory.Array, 3269Category = AtsTypeCategory.Array, 3275Category = AtsTypeCategory.Array, 3282Type = new AtsTypeRef { TypeId = "callback", Category = AtsTypeCategory.Callback }, 3288CallbackReturnType = new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive } 3295ReturnType = new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive }, 3537var contextType = new AtsTypeRef { TypeId = "Tests/MutableContext", Category = AtsTypeCategory.Dto }; 3553Type = new AtsTypeRef { TypeId = AtsConstants.String, Category = AtsTypeCategory.Primitive } 3566Type = new AtsTypeRef { TypeId = "callback", Category = AtsTypeCategory.Callback }, 3575Category = AtsTypeCategory.Primitive 3628var resourceType = new AtsTypeRef { TypeId = "Tests/ProbeResource", Category = AtsTypeCategory.Handle }; 3629var contextType = new AtsTypeRef { TypeId = "Tests/MutableContext", Category = AtsTypeCategory.Dto }; 3634Type = new AtsTypeRef { TypeId = "callback", Category = AtsTypeCategory.Callback }, 3639CallbackReturnType = new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive } 3646ReturnType = new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive }, 3668Type = new AtsTypeRef { TypeId = AtsConstants.String, Category = AtsTypeCategory.Primitive } 3855Type = new AtsTypeRef { TypeId = "KeywordProbe", Category = AtsTypeCategory.Dto } 3914new AtsTypeRef { TypeId = "string", Category = AtsTypeCategory.Primitive }); 3946Category = AtsTypeCategory.Dict, 3948KeyType = new AtsTypeRef { TypeId = "string", Category = AtsTypeCategory.Primitive }, 3949ValueType = new AtsTypeRef { TypeId = "string", Category = AtsTypeCategory.Primitive }
Aspire.Hosting.CodeGeneration.Python.Tests (20)
AtsPythonCodeGeneratorTests.cs (20)
393Category = AtsTypeCategory.Dto 862Category = AtsTypeCategory.Handle 886Category = AtsTypeCategory.Primitive 918Category = AtsTypeCategory.Handle 942Category = AtsTypeCategory.Primitive 977Category = AtsTypeCategory.Handle 984Category = AtsTypeCategory.Handle, 992Category = AtsTypeCategory.Handle, 1016Category = AtsTypeCategory.Primitive 1056Category = AtsTypeCategory.Union, 1062Category = AtsTypeCategory.Union, 1068Category = AtsTypeCategory.Primitive, 1076Category = AtsTypeCategory.Primitive 1111Category = AtsTypeCategory.Array, 1115Category = AtsTypeCategory.Primitive, 1125Category = AtsTypeCategory.Primitive 1161Category = AtsTypeCategory.Primitive 1167Category = AtsTypeCategory.Primitive 1174Category = AtsTypeCategory.Handle 1181Category = AtsTypeCategory.Handle
Aspire.Hosting.CodeGeneration.TypeScript.Tests (30)
AtsTypeScriptCodeGeneratorTests.cs (30)
283Category = AtsTypeCategory.Handle 288Category = AtsTypeCategory.Primitive 970Category = AtsTypeCategory.Primitive, 976Category = AtsTypeCategory.Array, 1027Category = AtsTypeCategory.Union, 1043Category = AtsTypeCategory.Primitive 1048Category = AtsTypeCategory.List, 1054Category = AtsTypeCategory.Dict, 1070Category = AtsTypeCategory.Primitive, 1076Category = AtsTypeCategory.Dict, 1077KeyType = new AtsTypeRef { TypeId = AtsConstants.String, Category = AtsTypeCategory.Primitive }, 1081Category = AtsTypeCategory.List, 1821Category = AtsTypeCategory.Handle 2105Category = AtsTypeCategory.Handle 2117Category = AtsTypeCategory.Primitive 2142Category = AtsTypeCategory.Primitive 3130Category = AtsTypeCategory.Handle 3135Category = AtsTypeCategory.Primitive 3140Category = AtsTypeCategory.Primitive 3335Category = AtsTypeCategory.Handle 3343Category = AtsTypeCategory.Handle 3429Category = AtsTypeCategory.Handle 3444Category = AtsTypeCategory.Primitive 3547Category = AtsTypeCategory.Handle 3562Category = AtsTypeCategory.Callback 3577Category = AtsTypeCategory.Primitive 3584Category = AtsTypeCategory.Primitive 3611Category = AtsTypeCategory.Primitive 3620Category = AtsTypeCategory.Primitive 3628Category = AtsTypeCategory.Primitive
Aspire.Hosting.Native.CodeGeneration (35)
src\Aspire.Hosting.RemoteHost\AtsCapabilityScanner.cs (35)
776typeRef.Category = AtsTypeCategory.Handle; 936Category = AtsTypeCategory.Handle, 967Category = AtsTypeCategory.Handle, 1178? new AtsTypeRef { TypeId = "callback", ClrType = prop.PropertyType, Category = AtsTypeCategory.Callback } 1704: new AtsTypeRef { TypeId = AtsConstants.Any, Category = AtsTypeCategory.Primitive }; 1709Category = AtsTypeCategory.Dict, 1731propertyTypeRef = new AtsTypeRef { TypeId = AtsConstants.Any, Category = AtsTypeCategory.Primitive }; 2244? new AtsTypeRef { TypeId = "callback", Category = AtsTypeCategory.Callback } 2301returnTypeRef = new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive }; 2305returnTypeRef = new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive }; 2313?? new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive } 2314: new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive }; 2319?? new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive } 2347var voidTypeRef = new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive }; 2683Category = AtsTypeCategory.Primitive 2720Category = typeRef.Category, 2798return new AtsTypeRef { TypeId = primitiveTypeId, ClrType = type, Category = AtsTypeCategory.Primitive }; 2804return new AtsTypeRef { TypeId = AtsConstants.Any, ClrType = type, Category = AtsTypeCategory.Primitive }; 2813Category = AtsTypeCategory.Dict, 2814KeyType = new AtsTypeRef { TypeId = AtsConstants.String, ClrType = typeof(string), Category = AtsTypeCategory.Primitive }, 2815ValueType = new AtsTypeRef { TypeId = AtsConstants.Any, ClrType = typeof(object), Category = AtsTypeCategory.Primitive }, 2826Category = AtsTypeCategory.List, 2827ElementType = new AtsTypeRef { TypeId = AtsConstants.Any, ClrType = typeof(object), Category = AtsTypeCategory.Primitive } 2841Category = AtsTypeCategory.Enum 2864Category = AtsTypeCategory.Dict, 2887Category = AtsTypeCategory.Dict, 2909Category = AtsTypeCategory.List, 2929Category = AtsTypeCategory.Array, 2974Category = AtsTypeCategory.Array, 2990Category = AtsTypeCategory.Dto, 3002Category = AtsTypeCategory.Handle, 3012Category = AtsTypeCategory.Unknown, 3107Category = AtsTypeCategory.Handle, 3174Category = AtsTypeCategory.Handle, 3432Category = 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)
776typeRef.Category = AtsTypeCategory.Handle; 936Category = AtsTypeCategory.Handle, 967Category = AtsTypeCategory.Handle, 1178? new AtsTypeRef { TypeId = "callback", ClrType = prop.PropertyType, Category = AtsTypeCategory.Callback } 1704: new AtsTypeRef { TypeId = AtsConstants.Any, Category = AtsTypeCategory.Primitive }; 1709Category = AtsTypeCategory.Dict, 1731propertyTypeRef = new AtsTypeRef { TypeId = AtsConstants.Any, Category = AtsTypeCategory.Primitive }; 2244? new AtsTypeRef { TypeId = "callback", Category = AtsTypeCategory.Callback } 2301returnTypeRef = new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive }; 2305returnTypeRef = new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive }; 2313?? new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive } 2314: new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive }; 2319?? new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive } 2347var voidTypeRef = new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive }; 2683Category = AtsTypeCategory.Primitive 2720Category = typeRef.Category, 2798return new AtsTypeRef { TypeId = primitiveTypeId, ClrType = type, Category = AtsTypeCategory.Primitive }; 2804return new AtsTypeRef { TypeId = AtsConstants.Any, ClrType = type, Category = AtsTypeCategory.Primitive }; 2813Category = AtsTypeCategory.Dict, 2814KeyType = new AtsTypeRef { TypeId = AtsConstants.String, ClrType = typeof(string), Category = AtsTypeCategory.Primitive }, 2815ValueType = new AtsTypeRef { TypeId = AtsConstants.Any, ClrType = typeof(object), Category = AtsTypeCategory.Primitive }, 2826Category = AtsTypeCategory.List, 2827ElementType = new AtsTypeRef { TypeId = AtsConstants.Any, ClrType = typeof(object), Category = AtsTypeCategory.Primitive } 2841Category = AtsTypeCategory.Enum 2864Category = AtsTypeCategory.Dict, 2887Category = AtsTypeCategory.Dict, 2909Category = AtsTypeCategory.List, 2929Category = AtsTypeCategory.Array, 2974Category = AtsTypeCategory.Array, 2990Category = AtsTypeCategory.Dto, 3002Category = AtsTypeCategory.Handle, 3012Category = AtsTypeCategory.Unknown, 3107Category = AtsTypeCategory.Handle, 3174Category = AtsTypeCategory.Handle, 3432Category = 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 },
138 references to Category
aspire-managed (1)
AppHostServerV2CodeGeneration.cs (1)
114if (type.Category == AtsTypeCategory.Handle)
Aspire.Hosting.CodeGeneration.Go (23)
AtsGoCodeGenerator.ApiProjection.cs (2)
874var returnsHandle = hasReturn && returnType!.Category == AtsTypeCategory.Handle; 1274if (typeRef.Category == AtsTypeCategory.Handle && typeRef.ClrType is { } clrType)
AtsGoCodeGenerator.cs (20)
723if (typeRef.Category == AtsTypeCategory.Handle) 1257var renderedValue = typeRef.Category switch 1275var valueType = typeRef.Category == AtsTypeCategory.Primitive 1513if (capability.ReturnType.Category != AtsTypeCategory.List 1514&& capability.ReturnType.Category != AtsTypeCategory.Dict) 1861if (returnType.Category != AtsTypeCategory.Handle) 2077if (p.Type?.Category != AtsTypeCategory.Handle) { continue; } 2248else if (p.CallbackParameters is { Count: > 0 } callbackParameters && callbackParameters.Any(cp => cp.Type.Category == AtsTypeCategory.Dto)) 2262if (callbackParameters[i].Type.Category == AtsTypeCategory.Dto) 2291&& type.Category == AtsTypeCategory.Handle 2324if (returnType.Category == AtsTypeCategory.Dict) 2450var value = p.Type?.Category == AtsTypeCategory.Handle 2525return property.Type.Category is AtsTypeCategory.Primitive or AtsTypeCategory.Enum 2533return type.Category switch 2609return parameter.Type is { Category: AtsTypeCategory.Primitive or AtsTypeCategory.Enum } 2721if (p.Type?.Category == AtsTypeCategory.Union) 2841if (hasReturn && capability.ReturnType!.Category == AtsTypeCategory.Handle) 3073var baseType = typeRef.Category switch 3111var baseType = typeRef.Category switch 3139&& 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)
934Assert.Equal(AtsTypeCategory.Handle, dependencyParam.Type.Category); 1302Assert.Equal(AtsTypeCategory.Dto, addNodePool.Parameters[^1].CallbackParameters![0].Type.Category); 1303Assert.Equal(AtsTypeCategory.Dto, withSystemNodePool.Parameters[^1].CallbackParameters![0].Type.Category); 2519Assert.Equal(AtsTypeCategory.Primitive, ctParam.Type.Category); 2615Assert.Equal(AtsTypeCategory.Dto, options.Type.Category); 2631Assert.Equal(AtsTypeCategory.Handle, legacyOptions.Type.Category); 2772Assert.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)
690if (typeRef.Category == AtsTypeCategory.Enum && typeRef.ClrType != null) 774if (typeRef.Category == AtsTypeCategory.Unknown && validTypes.Contains(typeRef.TypeId)) 869if (typeRef.Category == AtsTypeCategory.Unknown) 1397return typeRef.Category switch 2720Category = 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)
690if (typeRef.Category == AtsTypeCategory.Enum && typeRef.ClrType != null) 774if (typeRef.Category == AtsTypeCategory.Unknown && validTypes.Contains(typeRef.TypeId)) 869if (typeRef.Category == AtsTypeCategory.Unknown) 1397return typeRef.Category switch 2720Category = 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);