410 references to AtsConstants
Aspire.Hosting.CodeGeneration.Go (51)
AtsGoCodeGenerator.ApiProjection.cs (9)
244
TypeId =
AtsConstants
.CreateBuilderCapability,
259
var typeId = isBuilder ?
AtsConstants
.BuilderTypeId :
AtsConstants
.ApplicationTypeId;
395
usedBy: [
AtsConstants
.CreateBuilderCapability],
423
UsedBy = [
AtsConstants
.CreateBuilderCapability]
873
var hasReturn = returnType is not null && returnType.TypeId !=
AtsConstants
.Void;
996
if (string.Equals(typeId,
AtsConstants
.BuilderTypeId, StringComparison.Ordinal))
1001
CapabilityId =
AtsConstants
.BuildCapability,
1002
TargetTypeId =
AtsConstants
.BuilderTypeId,
AtsGoCodeGenerator.cs (42)
399
if (dto.TypeId ==
AtsConstants
.ReferenceExpressionTypeId)
413
if (handleType.AtsTypeId ==
AtsConstants
.ReferenceExpressionTypeId
718
if (typeRef.TypeId ==
AtsConstants
.ReferenceExpressionTypeId
966
var returnsValue = capability.ReturnType is not null && capability.ReturnType.TypeId !=
AtsConstants
.Void;
1069
if (dto.TypeId ==
AtsConstants
.ReferenceExpressionTypeId)
1580
if (string.Equals(typeId,
AtsConstants
.BuilderTypeId, StringComparison.Ordinal))
1582
var appInterface = _interfaceNames.TryGetValue(
AtsConstants
.ApplicationTypeId, out var appName)
1604
var errSummary = string.Equals(typeId,
AtsConstants
.BuilderTypeId, StringComparison.Ordinal)
1831
&& p.CallbackReturnType.TypeId !=
AtsConstants
.Void;
1848
var hasReturn = capability.ReturnType is not null && capability.ReturnType.TypeId !=
AtsConstants
.Void;
1955
var receiverErr = string.Equals(currentTypeId,
AtsConstants
.BuilderTypeId, StringComparison.Ordinal)
2222
&& p.CallbackReturnType.TypeId !=
AtsConstants
.Void;
2535
AtsTypeCategory.Primitive => type.TypeId is not (
AtsConstants
.Any or
AtsConstants
.ReferenceExpressionTypeId),
2840
var hasReturn = capability.ReturnType is not null && capability.ReturnType.TypeId !=
AtsConstants
.Void;
2864
WriteLine("\tc.registerHandleWrapper(\"" +
AtsConstants
.ReferenceExpressionTypeId + "\", func(h *handle, c *client) any {");
2894
var builderTypeId =
AtsConstants
.BuilderTypeId;
2901
var appTypeId =
AtsConstants
.ApplicationTypeId;
2962
WriteLine($"\tresult, err := b.client.invokeCapability(context.Background(), \"{
AtsConstants
.BuildCapability}\", map[string]any{{");
3020
WriteLine($"\tresult, err := c.invokeCapability(context.Background(), \"{
AtsConstants
.CreateBuilderCapability}\", map[string]any{{\"argsOrOptions\": resolved}})");
3065
if (typeRef.TypeId ==
AtsConstants
.ReferenceExpressionTypeId)
3106
if (typeRef.TypeId ==
AtsConstants
.ReferenceExpressionTypeId)
3140
&& typeRef.TypeId is not (
AtsConstants
.Void or
AtsConstants
.Any or
AtsConstants
.CancellationToken);
3168
AtsConstants
.String or
AtsConstants
.Char => "string",
3169
AtsConstants
.Number => MapNumericType(typeRef.ClrType),
3170
AtsConstants
.Boolean => "bool",
3171
AtsConstants
.Void => "",
3172
AtsConstants
.Any => "any",
3173
AtsConstants
.DateTime or
AtsConstants
.DateTimeOffset or
3174
AtsConstants
.DateOnly or
AtsConstants
.TimeOnly => "string",
3175
AtsConstants
.TimeSpan => "float64",
3176
AtsConstants
.Guid or
AtsConstants
.Uri => "string",
3177
AtsConstants
.CancellationToken => "*CancellationToken",
3203
string.Equals(capabilityId,
AtsConstants
.BuildCapability, StringComparison.Ordinal)
3204
|| string.Equals(capabilityId,
AtsConstants
.CreateBuilderCapability, StringComparison.Ordinal);
3210
string.Equals(typeId,
AtsConstants
.CancellationToken, StringComparison.Ordinal)
Aspire.Hosting.CodeGeneration.Go.Tests (22)
AtsGoCodeGeneratorTests.cs (4)
2638
TypeId =
AtsConstants
.String,
2644
TypeId =
AtsConstants
.Number,
2648
var voidType = new AtsTypeRef { TypeId =
AtsConstants
.Void, Category = AtsTypeCategory.Primitive };
2734
TypeId =
AtsConstants
.Number,
AtsGoDerivedBuilderTests.cs (7)
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 };
532
new AtsTypeInfo { AtsTypeId =
AtsConstants
.BuilderTypeId, IsInterface = true },
619
TypeId =
AtsConstants
.ArrayTypeId(element.TypeId),
627
TypeId =
AtsConstants
.ListTypeId(element.TypeId),
634
TypeId =
AtsConstants
.DictTypeId(key.TypeId, value.TypeId),
658
CallbackReturnType = new AtsTypeRef { TypeId =
AtsConstants
.Void, Category = AtsTypeCategory.Primitive }
GoDocCommentTests.cs (6)
448
var stringType = Primitive(
AtsConstants
.String);
449
var boolType = Primitive(
AtsConstants
.Boolean);
450
var voidType = Primitive(
AtsConstants
.Void);
464
Parameter("port", Primitive(
AtsConstants
.Number), "The port to use. Pass `name` to override.", isOptional: true),
488
Capability("port", Primitive(
AtsConstants
.Number), new AtsDocumentationInfo { Summary = "The port of the resource." },
521
new AtsDtoPropertyInfo { Name = "Port", Type = Primitive(
AtsConstants
.Number), Description = "The port of the resource." },
GoGeneratorEscapingTests.cs (5)
115
var stringType = Primitive(
AtsConstants
.String);
116
var numberType = Primitive(
AtsConstants
.Number);
117
var voidType = Primitive(
AtsConstants
.Void);
151
Capability("Tests/getExpression\"%d", "getExpression", Handle(
AtsConstants
.ReferenceExpressionTypeId), description: "Gets an expression."),
160
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 (19)
AtsJavaCodeGeneratorTests.cs (19)
719
var numberType = new AtsTypeRef { TypeId =
AtsConstants
.Number, Category = AtsTypeCategory.Primitive };
720
var booleanType = new AtsTypeRef { TypeId =
AtsConstants
.Boolean, Category = AtsTypeCategory.Primitive };
2998
var stringType = new AtsTypeRef { TypeId =
AtsConstants
.String, Category = AtsTypeCategory.Primitive };
3007
CallbackReturnType = new AtsTypeRef { TypeId =
AtsConstants
.Void, Category = AtsTypeCategory.Primitive }
3014
ReturnType = new AtsTypeRef { TypeId =
AtsConstants
.Void, Category = AtsTypeCategory.Primitive },
3039
Type = new AtsTypeRef { TypeId =
AtsConstants
.CancellationToken, Category = AtsTypeCategory.Dto }
3046
ReturnType = new AtsTypeRef { TypeId =
AtsConstants
.Void, Category = AtsTypeCategory.Primitive },
3081
TypeId =
AtsConstants
.Number,
3117
new AtsTypeRef { TypeId =
AtsConstants
.Boolean, Category = AtsTypeCategory.Primitive, IsNullable = true }),
3121
new AtsTypeRef { TypeId =
AtsConstants
.Number, Category = AtsTypeCategory.Primitive, IsNullable = true }),
3250
TypeId =
AtsConstants
.Number,
3256
TypeId =
AtsConstants
.Boolean,
3288
CallbackReturnType = new AtsTypeRef { TypeId =
AtsConstants
.Void, Category = AtsTypeCategory.Primitive }
3295
ReturnType = new AtsTypeRef { TypeId =
AtsConstants
.Void, Category = AtsTypeCategory.Primitive },
3553
Type = new AtsTypeRef { TypeId =
AtsConstants
.String, Category = AtsTypeCategory.Primitive }
3574
TypeId =
AtsConstants
.Void,
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 }
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)
885
TypeId =
AtsConstants
.String,
941
TypeId =
AtsConstants
.String,
1015
TypeId =
AtsConstants
.Void,
1067
TypeId =
AtsConstants
.Number,
1075
TypeId =
AtsConstants
.String,
1114
TypeId =
AtsConstants
.Number,
1124
TypeId =
AtsConstants
.Void,
1160
TypeId =
AtsConstants
.String,
1166
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 (22)
AtsTypeScriptCodeGeneratorTests.cs (22)
287
TypeId =
AtsConstants
.String,
677
Assert.Equal(
AtsConstants
.Void, setValue.ReturnType.TypeId);
969
TypeId =
AtsConstants
.Number,
975
TypeId = $"{
AtsConstants
.Number}[]",
1069
TypeId =
AtsConstants
.Number,
1077
KeyType = new AtsTypeRef { TypeId =
AtsConstants
.String, Category = AtsTypeCategory.Primitive },
1344
Assert.Equal(
AtsConstants
.String, image.Type?.TypeId);
2116
TypeId =
AtsConstants
.Void,
2141
TypeId =
AtsConstants
.Void,
2426
c.TargetTypeId ==
AtsConstants
.ReferenceExpressionTypeId);
2518
Assert.Equal(
AtsConstants
.CancellationToken, ctParam.Type.TypeId);
2553
Assert.Equal(
AtsConstants
.CancellationToken, operationParam.CallbackParameters[0].Type?.TypeId);
2572
Assert.Equal(
AtsConstants
.TimeSpan, timeoutParam.Type?.TypeId);
2576
Assert.Equal(
AtsConstants
.CancellationToken, ctParam.Type?.TypeId);
3134
TypeId =
AtsConstants
.String,
3139
TypeId =
AtsConstants
.Void,
3443
TypeId =
AtsConstants
.Void,
3576
TypeId =
AtsConstants
.Void,
3583
TypeId =
AtsConstants
.Void,
3610
TypeId =
AtsConstants
.String,
3619
TypeId =
AtsConstants
.Number,
3627
TypeId =
AtsConstants
.Void,
Aspire.Hosting.Native.CodeGeneration (50)
src\Aspire.Hosting.RemoteHost\AtsCapabilityScanner.cs (50)
98
var typeId =
AtsConstants
.EnumTypeId(fullName);
1399
AtsTypeCategory.Primitive => typeRef.TypeId !=
AtsConstants
.CancellationToken && typeRef.TypeId !=
AtsConstants
.Void,
1704
: new AtsTypeRef { TypeId =
AtsConstants
.Any, Category = AtsTypeCategory.Primitive };
1708
TypeId =
AtsConstants
.DictTypeId(keyTypeRef.TypeId, valueTypeRef.TypeId),
1731
propertyTypeRef = new AtsTypeRef { TypeId =
AtsConstants
.Any, Category = AtsTypeCategory.Primitive };
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 };
2465
if (
AtsConstants
.IsPrimitiveType(type))
2473
return
AtsConstants
.Any;
2478
return
AtsConstants
.DictTypeId(
AtsConstants
.String,
AtsConstants
.Any);
2483
return
AtsConstants
.ListTypeId(
AtsConstants
.Any);
2489
return
AtsConstants
.EnumTypeId(type.FullName ?? type.Name);
2511
return
AtsConstants
.DictTypeId(keyTypeName, valueTypeName);
2527
return
AtsConstants
.ListTypeId(elementTypeName);
2598
return
AtsConstants
.String;
2602
return
AtsConstants
.Char;
2606
return
AtsConstants
.Boolean;
2615
return
AtsConstants
.Number;
2621
return
AtsConstants
.DateTime;
2625
return
AtsConstants
.DateTimeOffset;
2629
return
AtsConstants
.DateOnly;
2633
return
AtsConstants
.TimeOnly;
2637
return
AtsConstants
.TimeSpan;
2643
return
AtsConstants
.Guid;
2647
return
AtsConstants
.Uri;
2651
return
AtsConstants
.CancellationToken;
2682
TypeId =
AtsConstants
.Void,
2804
return new AtsTypeRef { TypeId =
AtsConstants
.Any, ClrType = type, Category = AtsTypeCategory.Primitive };
2811
TypeId =
AtsConstants
.DictTypeId(
AtsConstants
.String,
AtsConstants
.Any),
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 },
2824
TypeId =
AtsConstants
.ListTypeId(
AtsConstants
.Any),
2827
ElementType = new AtsTypeRef { TypeId =
AtsConstants
.Any, ClrType = typeof(object), Category = AtsTypeCategory.Primitive }
2839
TypeId =
AtsConstants
.EnumTypeId(type.FullName ?? type.Name),
2862
TypeId =
AtsConstants
.DictTypeId(keyTypeRef.TypeId, valueTypeRef.TypeId),
2885
TypeId =
AtsConstants
.DictTypeId(keyTypeRef.TypeId, valueTypeRef.TypeId),
2907
TypeId =
AtsConstants
.ListTypeId(elementTypeRef.TypeId),
2927
TypeId =
AtsConstants
.ArrayTypeId(elementTypeRef.TypeId),
2972
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);
1399
AtsTypeCategory.Primitive => typeRef.TypeId !=
AtsConstants
.CancellationToken && typeRef.TypeId !=
AtsConstants
.Void,
1704
: new AtsTypeRef { TypeId =
AtsConstants
.Any, Category = AtsTypeCategory.Primitive };
1708
TypeId =
AtsConstants
.DictTypeId(keyTypeRef.TypeId, valueTypeRef.TypeId),
1731
propertyTypeRef = new AtsTypeRef { TypeId =
AtsConstants
.Any, Category = AtsTypeCategory.Primitive };
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 };
2465
if (
AtsConstants
.IsPrimitiveType(type))
2473
return
AtsConstants
.Any;
2478
return
AtsConstants
.DictTypeId(
AtsConstants
.String,
AtsConstants
.Any);
2483
return
AtsConstants
.ListTypeId(
AtsConstants
.Any);
2489
return
AtsConstants
.EnumTypeId(type.FullName ?? type.Name);
2511
return
AtsConstants
.DictTypeId(keyTypeName, valueTypeName);
2527
return
AtsConstants
.ListTypeId(elementTypeName);
2598
return
AtsConstants
.String;
2602
return
AtsConstants
.Char;
2606
return
AtsConstants
.Boolean;
2615
return
AtsConstants
.Number;
2621
return
AtsConstants
.DateTime;
2625
return
AtsConstants
.DateTimeOffset;
2629
return
AtsConstants
.DateOnly;
2633
return
AtsConstants
.TimeOnly;
2637
return
AtsConstants
.TimeSpan;
2643
return
AtsConstants
.Guid;
2647
return
AtsConstants
.Uri;
2651
return
AtsConstants
.CancellationToken;
2682
TypeId =
AtsConstants
.Void,
2804
return new AtsTypeRef { TypeId =
AtsConstants
.Any, ClrType = type, Category = AtsTypeCategory.Primitive };
2811
TypeId =
AtsConstants
.DictTypeId(
AtsConstants
.String,
AtsConstants
.Any),
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 },
2824
TypeId =
AtsConstants
.ListTypeId(
AtsConstants
.Any),
2827
ElementType = new AtsTypeRef { TypeId =
AtsConstants
.Any, ClrType = typeof(object), Category = AtsTypeCategory.Primitive }
2839
TypeId =
AtsConstants
.EnumTypeId(type.FullName ?? type.Name),
2862
TypeId =
AtsConstants
.DictTypeId(keyTypeRef.TypeId, valueTypeRef.TypeId),
2885
TypeId =
AtsConstants
.DictTypeId(keyTypeRef.TypeId, valueTypeRef.TypeId),
2907
TypeId =
AtsConstants
.ListTypeId(elementTypeRef.TypeId),
2927
TypeId =
AtsConstants
.ArrayTypeId(elementTypeRef.TypeId),
2972
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)
320
/// Use <see cref="
AtsConstants
.Void"/> TypeId for void return types.
AtsContext.cs (1)
110
if (
AtsConstants
.IsPrimitiveType(type))