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