397 references to AtsConstants
Aspire.Hosting.CodeGeneration.Go (45)
AtsGoCodeGenerator.ApiProjection.cs (7)
231
TypeId =
AtsConstants
.CreateBuilderCapability,
246
var typeId = isBuilder ?
AtsConstants
.BuilderTypeId :
AtsConstants
.ApplicationTypeId;
723
var hasReturn = returnType is not null && returnType.TypeId !=
AtsConstants
.Void;
848
if (string.Equals(typeId,
AtsConstants
.BuilderTypeId, StringComparison.Ordinal))
853
CapabilityId =
AtsConstants
.BuildCapability,
854
TargetTypeId =
AtsConstants
.BuilderTypeId,
AtsGoCodeGenerator.cs (38)
173
if (dto.TypeId ==
AtsConstants
.ReferenceExpressionTypeId)
187
if (handleType.AtsTypeId ==
AtsConstants
.ReferenceExpressionTypeId
447
if (typeRef.TypeId ==
AtsConstants
.ReferenceExpressionTypeId
694
var returnsValue = capability.ReturnType is not null && capability.ReturnType.TypeId !=
AtsConstants
.Void;
797
if (dto.TypeId ==
AtsConstants
.ReferenceExpressionTypeId)
1308
if (string.Equals(typeId,
AtsConstants
.BuilderTypeId, StringComparison.Ordinal))
1310
var appInterface = _interfaceNames.TryGetValue(
AtsConstants
.ApplicationTypeId, out var appName)
1579
&& p.CallbackReturnType.TypeId !=
AtsConstants
.Void;
1596
var hasReturn = capability.ReturnType is not null && capability.ReturnType.TypeId !=
AtsConstants
.Void;
1983
&& p.CallbackReturnType.TypeId !=
AtsConstants
.Void;
2387
var hasReturn = capability.ReturnType is not null && capability.ReturnType.TypeId !=
AtsConstants
.Void;
2411
WriteLine("\tc.registerHandleWrapper(\"" +
AtsConstants
.ReferenceExpressionTypeId + "\", func(h *handle, c *client) any {");
2441
var builderTypeId =
AtsConstants
.BuilderTypeId;
2448
var appTypeId =
AtsConstants
.ApplicationTypeId;
2498
WriteLine($"\tresult, err := b.client.invokeCapability(context.Background(), \"{
AtsConstants
.BuildCapability}\", map[string]any{{");
2556
WriteLine($"\tresult, err := c.invokeCapability(context.Background(), \"{
AtsConstants
.CreateBuilderCapability}\", map[string]any{{\"argsOrOptions\": resolved}})");
2601
if (typeRef.TypeId ==
AtsConstants
.ReferenceExpressionTypeId)
2642
if (typeRef.TypeId ==
AtsConstants
.ReferenceExpressionTypeId)
2676
&& typeRef.TypeId is not (
AtsConstants
.Void or
AtsConstants
.Any or
AtsConstants
.CancellationToken);
2704
AtsConstants
.String or
AtsConstants
.Char => "string",
2705
AtsConstants
.Number => "float64",
2706
AtsConstants
.Boolean => "bool",
2707
AtsConstants
.Void => "",
2708
AtsConstants
.Any => "any",
2709
AtsConstants
.DateTime or
AtsConstants
.DateTimeOffset or
2710
AtsConstants
.DateOnly or
AtsConstants
.TimeOnly => "string",
2711
AtsConstants
.TimeSpan => "float64",
2712
AtsConstants
.Guid or
AtsConstants
.Uri => "string",
2713
AtsConstants
.CancellationToken => "*CancellationToken",
2723
string.Equals(capabilityId,
AtsConstants
.BuildCapability, StringComparison.Ordinal)
2724
|| string.Equals(capabilityId,
AtsConstants
.CreateBuilderCapability, StringComparison.Ordinal);
2730
string.Equals(typeId,
AtsConstants
.CancellationToken, StringComparison.Ordinal)
Aspire.Hosting.CodeGeneration.Go.Tests (18)
AtsGoDerivedBuilderTests.cs (7)
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 };
531
new AtsTypeInfo { AtsTypeId =
AtsConstants
.BuilderTypeId, IsInterface = true },
618
TypeId =
AtsConstants
.ArrayTypeId(element.TypeId),
626
TypeId =
AtsConstants
.ListTypeId(element.TypeId),
633
TypeId =
AtsConstants
.DictTypeId(key.TypeId, value.TypeId),
657
CallbackReturnType = new AtsTypeRef { TypeId =
AtsConstants
.Void, Category = AtsTypeCategory.Primitive }
GoDocCommentTests.cs (6)
358
var stringType = Primitive(
AtsConstants
.String);
359
var boolType = Primitive(
AtsConstants
.Boolean);
360
var voidType = Primitive(
AtsConstants
.Void);
374
Parameter("port", Primitive(
AtsConstants
.Number), "The port to use. Pass `name` to override.", isOptional: true),
398
Capability("port", Primitive(
AtsConstants
.Number), new AtsDocumentationInfo { Summary = "The port of the resource." },
431
new AtsDtoPropertyInfo { Name = "Port", Type = Primitive(
AtsConstants
.Number), Description = "The port of the resource." },
GoGeneratorEscapingTests.cs (5)
91
var stringType = Primitive(
AtsConstants
.String);
92
var numberType = Primitive(
AtsConstants
.Number);
93
var voidType = Primitive(
AtsConstants
.Void);
127
Capability("Tests/getExpression\"%d", "getExpression", Handle(
AtsConstants
.ReferenceExpressionTypeId), description: "Gets an expression."),
136
parameters: [Parameter("cancel\"Token", Primitive(
AtsConstants
.CancellationToken), isOptional: true)])
Aspire.Hosting.CodeGeneration.Java (41)
AtsJavaCodeGenerator.cs (41)
733
if (dto.TypeId ==
AtsConstants
.ReferenceExpressionTypeId)
1337
var builderClassName = _classNames.TryGetValue(
AtsConstants
.BuilderTypeId, out var name)
1895
var hasReturn = capability.ReturnType?.TypeId !=
AtsConstants
.Void;
1910
var hasReturnType = callbackReturnType != null && callbackReturnType.TypeId !=
AtsConstants
.Void;
1944
var hasReturnType = callbackParam.CallbackReturnType != null && callbackParam.CallbackReturnType.TypeId !=
AtsConstants
.Void;
2000
var hasReturnType = property.CallbackReturnType != null && property.CallbackReturnType.TypeId !=
AtsConstants
.Void;
2030
if (callbackParameter.Type?.TypeId ==
AtsConstants
.CancellationToken)
2050
if (typeRef.TypeId ==
AtsConstants
.ReferenceExpressionTypeId)
2172
AtsConstants
.String or
AtsConstants
.Char or
2173
AtsConstants
.DateTime or
AtsConstants
.DateTimeOffset or
2174
AtsConstants
.DateOnly or
AtsConstants
.TimeOnly or
2175
AtsConstants
.Guid or
AtsConstants
.Uri => $"(String) {valueExpression}",
2176
AtsConstants
.Number or
AtsConstants
.TimeSpan => $"((Number) {valueExpression}).doubleValue()",
2177
AtsConstants
.Boolean => $"(Boolean) {valueExpression}",
2178
AtsConstants
.Void => "null",
2229
if (typeRef.TypeId ==
AtsConstants
.CancellationToken)
2339
var builderClassName = _classNames.TryGetValue(
AtsConstants
.BuilderTypeId, out var name)
2418
if (handleType.AtsTypeId ==
AtsConstants
.ReferenceExpressionTypeId
2569
if (typeRef.TypeId ==
AtsConstants
.ReferenceExpressionTypeId)
2601
if (typeRef.TypeId ==
AtsConstants
.ReferenceExpressionTypeId)
2659
AtsConstants
.String or
AtsConstants
.Char => "String",
2668
AtsConstants
.Number => useBoxedTypes ? "Number" : "double",
2669
AtsConstants
.Boolean => useBoxedTypes ? "Boolean" : "boolean",
2670
AtsConstants
.Void => "void",
2671
AtsConstants
.Any => "Object",
2672
AtsConstants
.DateTime or
AtsConstants
.DateTimeOffset or
2673
AtsConstants
.DateOnly or
AtsConstants
.TimeOnly => "String",
2674
AtsConstants
.TimeSpan => useBoxedTypes ? "Number" : "double",
2675
AtsConstants
.Guid or
AtsConstants
.Uri => "String",
2676
AtsConstants
.CancellationToken => "CancellationToken",
2686
string.Equals(typeId,
AtsConstants
.CancellationToken, StringComparison.Ordinal)
2697
if (typeRef.TypeId ==
AtsConstants
.ReferenceExpressionTypeId
Aspire.Hosting.CodeGeneration.Java.Tests (17)
AtsJavaCodeGeneratorTests.cs (17)
2776
var stringType = new AtsTypeRef { TypeId =
AtsConstants
.String, Category = AtsTypeCategory.Primitive };
2785
CallbackReturnType = new AtsTypeRef { TypeId =
AtsConstants
.Void, Category = AtsTypeCategory.Primitive }
2792
ReturnType = new AtsTypeRef { TypeId =
AtsConstants
.Void, Category = AtsTypeCategory.Primitive },
2817
Type = new AtsTypeRef { TypeId =
AtsConstants
.CancellationToken, Category = AtsTypeCategory.Dto }
2824
ReturnType = new AtsTypeRef { TypeId =
AtsConstants
.Void, Category = AtsTypeCategory.Primitive },
2859
TypeId =
AtsConstants
.Number,
2895
new AtsTypeRef { TypeId =
AtsConstants
.Boolean, Category = AtsTypeCategory.Primitive, IsNullable = true }),
2899
new AtsTypeRef { TypeId =
AtsConstants
.Number, Category = AtsTypeCategory.Primitive, IsNullable = true }),
3028
TypeId =
AtsConstants
.Number,
3034
TypeId =
AtsConstants
.Boolean,
3066
CallbackReturnType = new AtsTypeRef { TypeId =
AtsConstants
.Void, Category = AtsTypeCategory.Primitive }
3073
ReturnType = new AtsTypeRef { TypeId =
AtsConstants
.Void, Category = AtsTypeCategory.Primitive },
3331
Type = new AtsTypeRef { TypeId =
AtsConstants
.String, Category = AtsTypeCategory.Primitive }
3352
TypeId =
AtsConstants
.Void,
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 }
Aspire.Hosting.CodeGeneration.Python (26)
AtsPythonCodeGenerator.cs (26)
148
AtsConstants
.ReferenceExpressionTypeId,
247
&& typeRef.TypeId is not (
AtsConstants
.Void or
AtsConstants
.Any or
AtsConstants
.CancellationToken);
254
AtsConstants
.String or
AtsConstants
.Char => "str",
255
AtsConstants
.Number => "int",
256
AtsConstants
.Boolean => "bool",
257
AtsConstants
.Void => "None",
258
AtsConstants
.Any => "typing.Any",
259
AtsConstants
.DateTime => "datetime.datetime",
260
AtsConstants
.DateTimeOffset => "datetime.datetime",
261
AtsConstants
.DateOnly => "datetime.date",
262
AtsConstants
.TimeOnly => "datetime.time",
263
AtsConstants
.TimeSpan => "float",
264
AtsConstants
.Guid or
AtsConstants
.Uri => "str",
265
AtsConstants
.CancellationToken => "CancellationToken",
275
if (param.Type?.TypeId ==
AtsConstants
.CancellationToken)
288
if (param.Type?.TypeId ==
AtsConstants
.CancellationToken)
297
var writeback = parameter.CallbackReturnType?.TypeId ==
AtsConstants
.Void &&
298
parameter.CallbackParameters?.Any(p => p.Type.Category == AtsTypeCategory.Dto && p.Type.TypeId !=
AtsConstants
.CancellationToken) == true
459
filtered = filtered.Where(p => p.Type?.TypeId !=
AtsConstants
.CancellationToken);
471
if (param.Type?.TypeId ==
AtsConstants
.CancellationToken)
533
if (typeRef.Category == AtsTypeCategory.Primitive && typeRef.TypeId ==
AtsConstants
.Void)
666
if (param.Type?.TypeId ==
AtsConstants
.CancellationToken)
Aspire.Hosting.CodeGeneration.Python.Tests (9)
AtsPythonCodeGeneratorTests.cs (9)
893
TypeId =
AtsConstants
.String,
949
TypeId =
AtsConstants
.String,
1023
TypeId =
AtsConstants
.Void,
1075
TypeId =
AtsConstants
.Number,
1083
TypeId =
AtsConstants
.String,
1122
TypeId =
AtsConstants
.Number,
1132
TypeId =
AtsConstants
.Void,
1168
TypeId =
AtsConstants
.String,
1174
TypeId =
AtsConstants
.Boolean,
Aspire.Hosting.CodeGeneration.Rust (43)
AtsRustCodeGenerator.cs (43)
207
if (dto.TypeId ==
AtsConstants
.ReferenceExpressionTypeId)
378
if (typeRef.TypeId ==
AtsConstants
.ReferenceExpressionTypeId
474
var hasReturn = capability.ReturnType.TypeId !=
AtsConstants
.Void;
611
else if (returnTypeRef?.TypeId ==
AtsConstants
.CancellationToken)
715
var builderStructName = _structNames.TryGetValue(
AtsConstants
.BuilderTypeId, out var name)
783
if (handleType.AtsTypeId ==
AtsConstants
.ReferenceExpressionTypeId
907
if (typeRef.TypeId ==
AtsConstants
.ReferenceExpressionTypeId)
945
if (typeRef.TypeId ==
AtsConstants
.ReferenceExpressionTypeId)
985
if (typeRef.TypeId ==
AtsConstants
.ReferenceExpressionTypeId)
1015
AtsConstants
.String or
AtsConstants
.Char => "String",
1016
AtsConstants
.Number => "f64",
1017
AtsConstants
.Boolean => "bool",
1018
AtsConstants
.Void => "()",
1019
AtsConstants
.Any => "Value",
1020
AtsConstants
.DateTime or
AtsConstants
.DateTimeOffset or
1021
AtsConstants
.DateOnly or
AtsConstants
.TimeOnly => "String",
1022
AtsConstants
.TimeSpan => "f64",
1023
AtsConstants
.Guid or
AtsConstants
.Uri => "String",
1024
AtsConstants
.CancellationToken => "CancellationToken",
1041
AtsConstants
.String or
AtsConstants
.Char => "&str",
1042
AtsConstants
.Number => "f64",
1043
AtsConstants
.Boolean => "bool",
1044
AtsConstants
.Void => "()",
1045
AtsConstants
.Any => "&Value",
1046
AtsConstants
.DateTime or
AtsConstants
.DateTimeOffset or
1047
AtsConstants
.DateOnly or
AtsConstants
.TimeOnly => "&str",
1048
AtsConstants
.TimeSpan => "f64",
1049
AtsConstants
.Guid or
AtsConstants
.Uri => "&str",
1050
AtsConstants
.CancellationToken => "&CancellationToken",
1064
&& typeRef.TypeId is not (
AtsConstants
.Void or
AtsConstants
.Any or
AtsConstants
.CancellationToken);
1068
&& typeRef.TypeId !=
AtsConstants
.ReferenceExpressionTypeId
1086
string.Equals(typeId,
AtsConstants
.CancellationToken, StringComparison.Ordinal)
1097
if (typeRef.TypeId ==
AtsConstants
.ReferenceExpressionTypeId
Aspire.Hosting.CodeGeneration.TypeScript (36)
AtsTypeScriptCodeGenerator.cs (14)
136
capability.ReturnType.TypeId ==
AtsConstants
.Void ? null : capability.Documentation?.Returns,
137
suppressReturns: capability.ReturnType.TypeId ==
AtsConstants
.Void,
950
var isVoid = capability.ReturnType == null || capability.ReturnType.TypeId ==
AtsConstants
.Void;
1227
if (capability.ReturnType?.TypeId ==
AtsConstants
.CancellationToken)
1811
else if (capability.ReturnType?.TypeId ==
AtsConstants
.CancellationToken)
1889
&& callbackParam.CallbackReturnType.TypeId !=
AtsConstants
.Void;
1926
if (cbTypeId ==
AtsConstants
.CancellationToken)
1953
var builderHandle = TypeScriptApiProjector.GetHandleTypeName(
AtsConstants
.BuilderTypeId);
2287
if (getter.ReturnType?.TypeId ==
AtsConstants
.CancellationToken)
2367
if (getter.ReturnType?.TypeId ==
AtsConstants
.CancellationToken)
2716
else if (method.ReturnType?.TypeId ==
AtsConstants
.CancellationToken)
2904
var isVoid = capability.ReturnType == null || capability.ReturnType.TypeId ==
AtsConstants
.Void;
3065
if (capability.ReturnType?.TypeId ==
AtsConstants
.CancellationToken)
3130
var isVoid = capability.ReturnType == null || capability.ReturnType.TypeId ==
AtsConstants
.Void;
TypeScriptApiProjector.cs (22)
424
if (capability.ReturnType is null || capability.ReturnType.TypeId ==
AtsConstants
.Void)
1663
if (typeRef.TypeId ==
AtsConstants
.ReferenceExpressionTypeId)
1715
return typeRef.TypeId is
AtsConstants
.Void or
AtsConstants
.Any or
AtsConstants
.CancellationToken
1764
AtsConstants
.String or
AtsConstants
.Char => "string",
1765
AtsConstants
.Number => "number",
1766
AtsConstants
.Boolean => "boolean",
1767
AtsConstants
.Void => "void",
1768
AtsConstants
.Any => "any",
1769
AtsConstants
.DateTime or
AtsConstants
.DateTimeOffset or
1770
AtsConstants
.DateOnly or
AtsConstants
.TimeOnly => "string",
1771
AtsConstants
.TimeSpan => "number",
1772
AtsConstants
.Guid or
AtsConstants
.Uri => "string",
1773
AtsConstants
.CancellationToken => GetCancellationTokenInterfaceName(),
2011
internal static bool IsCancellationTokenType(AtsTypeRef? typeRef) => typeRef?.TypeId ==
AtsConstants
.CancellationToken;
2674
if (targetTypeId is
AtsConstants
.ReferenceExpressionTypeId or InteractionInputCollectionTypeId)
3112
var returnType = callbackReturnType == null || callbackReturnType.TypeId ==
AtsConstants
.Void
Aspire.Hosting.CodeGeneration.TypeScript.Tests (21)
AtsTypeScriptCodeGeneratorTests.cs (21)
288
TypeId =
AtsConstants
.String,
659
Assert.Equal(
AtsConstants
.Void, setValue.ReturnType.TypeId);
951
TypeId =
AtsConstants
.Number,
957
TypeId = $"{
AtsConstants
.Number}[]",
1051
TypeId =
AtsConstants
.Number,
1059
KeyType = new AtsTypeRef { TypeId =
AtsConstants
.String, Category = AtsTypeCategory.Primitive },
2008
TypeId =
AtsConstants
.Void,
2033
TypeId =
AtsConstants
.Void,
2318
c.TargetTypeId ==
AtsConstants
.ReferenceExpressionTypeId);
2410
Assert.Equal(
AtsConstants
.CancellationToken, ctParam.Type.TypeId);
2445
Assert.Equal(
AtsConstants
.CancellationToken, operationParam.CallbackParameters[0].Type?.TypeId);
2464
Assert.Equal(
AtsConstants
.TimeSpan, timeoutParam.Type?.TypeId);
2468
Assert.Equal(
AtsConstants
.CancellationToken, ctParam.Type?.TypeId);
3021
TypeId =
AtsConstants
.String,
3026
TypeId =
AtsConstants
.Void,
3330
TypeId =
AtsConstants
.Void,
3463
TypeId =
AtsConstants
.Void,
3470
TypeId =
AtsConstants
.Void,
3497
TypeId =
AtsConstants
.String,
3506
TypeId =
AtsConstants
.Number,
3514
TypeId =
AtsConstants
.Void,
Aspire.Hosting.Native.CodeGeneration (50)
src\Aspire.Hosting.RemoteHost\AtsCapabilityScanner.cs (50)
98
var typeId =
AtsConstants
.EnumTypeId(fullName);
1386
AtsTypeCategory.Primitive => typeRef.TypeId !=
AtsConstants
.CancellationToken && typeRef.TypeId !=
AtsConstants
.Void,
1691
: new AtsTypeRef { TypeId =
AtsConstants
.Any, Category = AtsTypeCategory.Primitive };
1695
TypeId =
AtsConstants
.DictTypeId(keyTypeRef.TypeId, valueTypeRef.TypeId),
1718
propertyTypeRef = new AtsTypeRef { TypeId =
AtsConstants
.Any, Category = AtsTypeCategory.Primitive };
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 };
2452
if (
AtsConstants
.IsPrimitiveType(type))
2460
return
AtsConstants
.Any;
2465
return
AtsConstants
.DictTypeId(
AtsConstants
.String,
AtsConstants
.Any);
2470
return
AtsConstants
.ListTypeId(
AtsConstants
.Any);
2476
return
AtsConstants
.EnumTypeId(type.FullName ?? type.Name);
2498
return
AtsConstants
.DictTypeId(keyTypeName, valueTypeName);
2514
return
AtsConstants
.ListTypeId(elementTypeName);
2585
return
AtsConstants
.String;
2589
return
AtsConstants
.Char;
2593
return
AtsConstants
.Boolean;
2602
return
AtsConstants
.Number;
2608
return
AtsConstants
.DateTime;
2612
return
AtsConstants
.DateTimeOffset;
2616
return
AtsConstants
.DateOnly;
2620
return
AtsConstants
.TimeOnly;
2624
return
AtsConstants
.TimeSpan;
2630
return
AtsConstants
.Guid;
2634
return
AtsConstants
.Uri;
2638
return
AtsConstants
.CancellationToken;
2669
TypeId =
AtsConstants
.Void,
2791
return new AtsTypeRef { TypeId =
AtsConstants
.Any, ClrType = type, Category = AtsTypeCategory.Primitive };
2798
TypeId =
AtsConstants
.DictTypeId(
AtsConstants
.String,
AtsConstants
.Any),
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 },
2811
TypeId =
AtsConstants
.ListTypeId(
AtsConstants
.Any),
2814
ElementType = new AtsTypeRef { TypeId =
AtsConstants
.Any, ClrType = typeof(object), Category = AtsTypeCategory.Primitive }
2826
TypeId =
AtsConstants
.EnumTypeId(type.FullName ?? type.Name),
2849
TypeId =
AtsConstants
.DictTypeId(keyTypeRef.TypeId, valueTypeRef.TypeId),
2872
TypeId =
AtsConstants
.DictTypeId(keyTypeRef.TypeId, valueTypeRef.TypeId),
2894
TypeId =
AtsConstants
.ListTypeId(elementTypeRef.TypeId),
2914
TypeId =
AtsConstants
.ArrayTypeId(elementTypeRef.TypeId),
2959
TypeId =
AtsConstants
.ArrayTypeId(elementTypeRef.TypeId),
Aspire.Hosting.RemoteHost (55)
Ats\AtsMarshaller.cs (2)
144
if (typeRef.TypeId ==
AtsConstants
.CancellationToken && value is CancellationToken cancellationToken)
150
if (typeRef.TypeId == TypeSystem.
AtsConstants
.Any)
Ats\ExternalCapabilityRegistry.cs (2)
606
.Where(parameter => parameter.Type?.TypeId ==
AtsConstants
.CancellationToken)
760
$"Integration capability '{capability.Id}' must declare returnType; use '{
AtsConstants
.Void}' for a void method.");
AtsCapabilityScanner.cs (50)
98
var typeId =
AtsConstants
.EnumTypeId(fullName);
1386
AtsTypeCategory.Primitive => typeRef.TypeId !=
AtsConstants
.CancellationToken && typeRef.TypeId !=
AtsConstants
.Void,
1691
: new AtsTypeRef { TypeId =
AtsConstants
.Any, Category = AtsTypeCategory.Primitive };
1695
TypeId =
AtsConstants
.DictTypeId(keyTypeRef.TypeId, valueTypeRef.TypeId),
1718
propertyTypeRef = new AtsTypeRef { TypeId =
AtsConstants
.Any, Category = AtsTypeCategory.Primitive };
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 };
2452
if (
AtsConstants
.IsPrimitiveType(type))
2460
return
AtsConstants
.Any;
2465
return
AtsConstants
.DictTypeId(
AtsConstants
.String,
AtsConstants
.Any);
2470
return
AtsConstants
.ListTypeId(
AtsConstants
.Any);
2476
return
AtsConstants
.EnumTypeId(type.FullName ?? type.Name);
2498
return
AtsConstants
.DictTypeId(keyTypeName, valueTypeName);
2514
return
AtsConstants
.ListTypeId(elementTypeName);
2585
return
AtsConstants
.String;
2589
return
AtsConstants
.Char;
2593
return
AtsConstants
.Boolean;
2602
return
AtsConstants
.Number;
2608
return
AtsConstants
.DateTime;
2612
return
AtsConstants
.DateTimeOffset;
2616
return
AtsConstants
.DateOnly;
2620
return
AtsConstants
.TimeOnly;
2624
return
AtsConstants
.TimeSpan;
2630
return
AtsConstants
.Guid;
2634
return
AtsConstants
.Uri;
2638
return
AtsConstants
.CancellationToken;
2669
TypeId =
AtsConstants
.Void,
2791
return new AtsTypeRef { TypeId =
AtsConstants
.Any, ClrType = type, Category = AtsTypeCategory.Primitive };
2798
TypeId =
AtsConstants
.DictTypeId(
AtsConstants
.String,
AtsConstants
.Any),
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 },
2811
TypeId =
AtsConstants
.ListTypeId(
AtsConstants
.Any),
2814
ElementType = new AtsTypeRef { TypeId =
AtsConstants
.Any, ClrType = typeof(object), Category = AtsTypeCategory.Primitive }
2826
TypeId =
AtsConstants
.EnumTypeId(type.FullName ?? type.Name),
2849
TypeId =
AtsConstants
.DictTypeId(keyTypeRef.TypeId, valueTypeRef.TypeId),
2872
TypeId =
AtsConstants
.DictTypeId(keyTypeRef.TypeId, valueTypeRef.TypeId),
2894
TypeId =
AtsConstants
.ListTypeId(elementTypeRef.TypeId),
2914
TypeId =
AtsConstants
.ArrayTypeId(elementTypeRef.TypeId),
2959
TypeId =
AtsConstants
.ArrayTypeId(elementTypeRef.TypeId),
AtsContextFilter.cs (1)
344
TypeId =
AtsConstants
.Void,
Aspire.Hosting.RemoteHost.Tests (34)
AtsCapabilityScannerTests.cs (9)
170
[InlineData(typeof(double?[]),
AtsConstants
.Number)]
171
[InlineData(typeof(bool?[]),
AtsConstants
.Boolean)]
194
Assert.Contains(parameter.Type.UnionTypes!, type => type.TypeId ==
AtsConstants
.String);
491
Assert.Equal(
AtsConstants
.String, nameGetter.ReturnType.TypeId);
496
Assert.Equal(
AtsConstants
.String, descriptionGetter.ReturnType.TypeId);
517
Assert.Equal(
AtsConstants
.String, nullableString.Type.TypeId);
522
Assert.Equal(
AtsConstants
.String, requiredString.Type.TypeId);
527
Assert.Equal(
AtsConstants
.Number, nullableNumber.Type.TypeId);
532
Assert.Equal(
AtsConstants
.Number, requiredNumber.Type.TypeId);
AtsContextFilterTests.cs (11)
136
type => Assert.Equal(
AtsConstants
.EnumTypeId(typeof(TestMode).FullName!), type.TypeId));
163
Assert.Contains(filteredContext.EnumTypes, type => type.TypeId ==
AtsConstants
.EnumTypeId(typeof(DistributedApplicationOperation).FullName!));
164
Assert.Contains(filteredContext.EnumTypes, type => type.TypeId ==
AtsConstants
.EnumTypeId("Aspire.TypeSystem.ExportedValueMode"));
231
Assert.Equal(
AtsConstants
.Void, filteredSupport.ReturnType.TypeId);
248
TypeId =
AtsConstants
.EnumTypeId("Some.Foreign.Dependency.ForeignMode"),
256
TypeId =
AtsConstants
.EnumTypeId("Some.Foreign.Dependency.ForeignCallbackMode"),
285
Type = new AtsTypeRef { TypeId =
AtsConstants
.Void, Category = AtsTypeCategory.Primitive },
434
TypeId =
AtsConstants
.EnumTypeId(typeof(TestMode).FullName!),
453
TypeId =
AtsConstants
.EnumTypeId(typeof(TestMode).FullName!),
461
TypeId =
AtsConstants
.EnumTypeId("Aspire.TypeSystem.ExportedValueMode"),
469
TypeId =
AtsConstants
.EnumTypeId(typeof(DistributedApplicationOperation).FullName!),
AtsMarshallerTests.cs (10)
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 }
198
new AtsTypeRef { TypeId =
AtsConstants
.String, ClrType = typeof(string), Category = AtsTypeCategory.Primitive },
220
new AtsTypeRef { TypeId =
AtsConstants
.String, ClrType = typeof(string), Category = AtsTypeCategory.Primitive },
221
new AtsTypeRef { TypeId =
AtsConstants
.Boolean, ClrType = typeof(bool), Category = AtsTypeCategory.Primitive }
293
TypeId =
AtsConstants
.CancellationToken,
1423
var conditionHandleId = registry.Register(condition,
AtsConstants
.ReferenceExpressionTypeId);
1465
var conditionHandleId = registry.Register(condition,
AtsConstants
.ReferenceExpressionTypeId);
1507
var conditionHandleId = registry.Register(condition,
AtsConstants
.ReferenceExpressionTypeId);
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 },
HandleRegistryTests.cs (1)
350
var typeId =
AtsConstants
.ReferenceExpressionTypeId;
Aspire.TypeSystem (2)
AtsCapabilityInfo.cs (1)
314
/// Use <see cref="
AtsConstants
.Void"/> TypeId for void return types.
AtsContext.cs (1)
110
if (
AtsConstants
.IsPrimitiveType(type))