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