31 writes to TypeId
Aspire.Hosting (31)
Ats\AtsCapabilityScanner.cs (31)
702
TypeId
= originalTarget,
732
TypeId
= typeInfo.AtsTypeId,
988
: new AtsTypeRef {
TypeId
= AtsConstants.Any, Category = AtsTypeCategory.Primitive };
992
TypeId
= AtsConstants.DictTypeId(keyTypeRef.TypeId, valueTypeRef.TypeId),
1015
propertyTypeRef = new AtsTypeRef {
TypeId
= AtsConstants.Any, Category = AtsTypeCategory.Primitive };
1034
TypeId
= typeId,
1138
TypeId
= typeId,
1448
? new AtsTypeRef {
TypeId
= "callback", Category = AtsTypeCategory.Callback }
1501
returnTypeRef = new AtsTypeRef {
TypeId
= AtsConstants.Void, Category = AtsTypeCategory.Primitive };
1505
returnTypeRef = new AtsTypeRef {
TypeId
= AtsConstants.Void, Category = AtsTypeCategory.Primitive };
1513
?? new AtsTypeRef {
TypeId
= AtsConstants.Void, Category = AtsTypeCategory.Primitive }
1514
: new AtsTypeRef {
TypeId
= AtsConstants.Void, Category = AtsTypeCategory.Primitive };
1519
?? new AtsTypeRef {
TypeId
= AtsConstants.Void, Category = AtsTypeCategory.Primitive };
1545
var voidTypeRef = new AtsTypeRef {
TypeId
= AtsConstants.Void, Category = AtsTypeCategory.Primitive };
1862
TypeId
= AtsConstants.Void,
1929
return new AtsTypeRef {
TypeId
= primitiveTypeId, ClrType = type, Category = AtsTypeCategory.Primitive };
1935
return new AtsTypeRef {
TypeId
= AtsConstants.Any, ClrType = type, Category = AtsTypeCategory.Primitive };
1946
TypeId
= AtsConstants.EnumTypeId(type.FullName ?? type.Name),
1969
TypeId
= AtsConstants.DictTypeId(keyTypeRef.TypeId, valueTypeRef.TypeId),
1992
TypeId
= AtsConstants.DictTypeId(keyTypeRef.TypeId, valueTypeRef.TypeId),
2014
TypeId
= AtsConstants.ListTypeId(elementTypeRef.TypeId),
2034
TypeId
= AtsConstants.ArrayTypeId(elementTypeRef.TypeId),
2062
TypeId
= constraintTypeId,
2073
TypeId
= typeId,
2093
TypeId
= AtsConstants.ArrayTypeId(elementTypeRef.TypeId),
2109
TypeId
= AtsTypeMapping.DeriveTypeId(type),
2121
TypeId
= AtsTypeMapping.DeriveTypeId(type),
2131
TypeId
= AtsTypeMapping.DeriveTypeId(type),
2211
TypeId
= ifaceTypeId,
2246
TypeId
= baseTypeId,
2505
TypeId
= string.Join("|", unionTypes.Select(u => u.TypeId)),
155 references to TypeId
Aspire.Hosting (20)
Ats\AtsCapabilityScanner.cs (20)
502
enumTypes.TryAdd(typeRef.
TypeId
, typeRef.ClrType);
541
if (typeRef.Category == AtsTypeCategory.Unknown && validTypes.Contains(typeRef.
TypeId
))
638
return typeRef.
TypeId
;
741
AddToCompatibilityMap(typeToCompatibleTypes, iface.
TypeId
, concreteTypeRef);
747
AddToCompatibilityMap(typeToCompatibleTypes, baseType.
TypeId
, concreteTypeRef);
780
.SelectMany(c => c.ExpandedTargetTypes.Select(t => (Target: t.
TypeId
, Capability: c)))
992
TypeId = AtsConstants.DictTypeId(keyTypeRef.
TypeId
, valueTypeRef.
TypeId
),
998
propertyTypeId = propertyTypeRef.
TypeId
;
1011
propertyTypeId = propertyTypeRef.
TypeId
;
1016
propertyTypeId = propertyTypeRef.
TypeId
;
1338
var firstParamTypeId = extendsTypeRef?.
TypeId
?? MapToAtsTypeId(firstParamType);
1969
TypeId = AtsConstants.DictTypeId(keyTypeRef.
TypeId
, valueTypeRef.
TypeId
),
1992
TypeId = AtsConstants.DictTypeId(keyTypeRef.
TypeId
, valueTypeRef.
TypeId
),
2014
TypeId = AtsConstants.ListTypeId(elementTypeRef.
TypeId
),
2034
TypeId = AtsConstants.ArrayTypeId(elementTypeRef.
TypeId
),
2093
TypeId = AtsConstants.ArrayTypeId(elementTypeRef.
TypeId
),
2505
TypeId = string.Join("|", unionTypes.Select(u => u.
TypeId
)),
Aspire.Hosting.CodeGeneration.Go (14)
AtsGoCodeGenerator.cs (14)
296
var hasReturn = capability.ReturnType.
TypeId
!= AtsConstants.Void;
605
if (targetType.
TypeId
is null)
610
if (!result.TryGetValue(targetType.
TypeId
, out var list))
613
result[targetType.
TypeId
] = list;
655
if (typeRef.
TypeId
== AtsConstants.ReferenceExpressionTypeId)
662
AtsTypeCategory.Primitive => MapPrimitiveType(typeRef.
TypeId
),
663
AtsTypeCategory.Enum => MapEnumType(typeRef.
TypeId
),
664
AtsTypeCategory.Handle => "*" + MapHandleType(typeRef.
TypeId
),
665
AtsTypeCategory.Dto => "*" + MapDtoType(typeRef.
TypeId
),
708
parameter.Type?.
TypeId
== AtsConstants.CancellationToken;
718
if (typeRef.
TypeId
== AtsConstants.ReferenceExpressionTypeId)
725
handleTypeIds.Add(typeRef.
TypeId
);
740
typeIds[typeRef.
TypeId
] = false; // false = List
747
typeIds[typeRef.
TypeId
] = true; // true = Dict
Aspire.Hosting.CodeGeneration.Go.Tests (2)
AtsGoCodeGeneratorTests.cs (2)
82
Assert.Contains(addTestRedis.Parameters, p => p.Name == "name" && p.Type?.
TypeId
== "string");
200
.Any(i => i.
TypeId
.Contains("IResourceWithEnvironment"));
Aspire.Hosting.CodeGeneration.Java (14)
AtsJavaCodeGenerator.cs (14)
276
var hasReturn = capability.ReturnType.
TypeId
!= AtsConstants.Void;
572
if (targetType.
TypeId
is null)
577
if (!result.TryGetValue(targetType.
TypeId
, out var list))
580
result[targetType.
TypeId
] = list;
620
if (typeRef.
TypeId
== AtsConstants.ReferenceExpressionTypeId)
627
AtsTypeCategory.Primitive => MapPrimitiveType(typeRef.
TypeId
, isOptional),
628
AtsTypeCategory.Enum => MapEnumType(typeRef.
TypeId
),
629
AtsTypeCategory.Handle => MapHandleType(typeRef.
TypeId
),
630
AtsTypeCategory.Dto => MapDtoType(typeRef.
TypeId
),
672
parameter.Type?.
TypeId
== AtsConstants.CancellationToken;
682
if (typeRef.
TypeId
== AtsConstants.ReferenceExpressionTypeId)
689
handleTypeIds.Add(typeRef.
TypeId
);
704
typeIds[typeRef.
TypeId
] = false; // false = List
711
typeIds[typeRef.
TypeId
] = true; // true = Dict
Aspire.Hosting.CodeGeneration.Java.Tests (2)
AtsJavaCodeGeneratorTests.cs (2)
81
Assert.Contains(addTestRedis.Parameters, p => p.Name == "name" && p.Type?.
TypeId
== "string");
199
.Any(i => i.
TypeId
.Contains("IResourceWithEnvironment"));
Aspire.Hosting.CodeGeneration.Python (13)
AtsPythonCodeGenerator.cs (13)
290
if (capability.ReturnType.
TypeId
== AtsConstants.Void)
480
if (targetType.
TypeId
is null)
485
if (!result.TryGetValue(targetType.
TypeId
, out var list))
488
result[targetType.
TypeId
] = list;
574
if (typeRef.
TypeId
== AtsConstants.ReferenceExpressionTypeId)
581
AtsTypeCategory.Primitive => MapPrimitiveType(typeRef.
TypeId
),
582
AtsTypeCategory.Enum => MapEnumType(typeRef.
TypeId
),
583
AtsTypeCategory.Handle => MapHandleType(typeRef.
TypeId
),
584
AtsTypeCategory.Dto => MapDtoType(typeRef.
TypeId
),
649
parameter.Type?.
TypeId
== AtsConstants.CancellationToken;
660
handleTypeIds.Add(typeRef.
TypeId
);
675
typeIds[typeRef.
TypeId
] = false; // false = List
682
typeIds[typeRef.
TypeId
] = true; // true = Dict
Aspire.Hosting.CodeGeneration.Python.Tests (2)
AtsPythonCodeGeneratorTests.cs (2)
82
Assert.Contains(addTestRedis.Parameters, p => p.Name == "name" && p.Type?.
TypeId
== "string");
200
.Any(i => i.
TypeId
.Contains("IResourceWithEnvironment"));
Aspire.Hosting.CodeGeneration.Rust (21)
AtsRustCodeGenerator.cs (21)
322
var hasReturn = capability.ReturnType.
TypeId
!= AtsConstants.Void;
421
var wrappedType = MapHandleType(returnTypeRef.
TypeId
);
425
else if (returnTypeRef?.
TypeId
== AtsConstants.CancellationToken)
639
if (targetType.
TypeId
is null)
644
if (!result.TryGetValue(targetType.
TypeId
, out var list))
647
result[targetType.
TypeId
] = list;
686
if (typeRef.
TypeId
== AtsConstants.ReferenceExpressionTypeId)
693
AtsTypeCategory.Primitive => MapPrimitiveType(typeRef.
TypeId
),
694
AtsTypeCategory.Enum => MapEnumType(typeRef.
TypeId
),
695
AtsTypeCategory.Handle => MapHandleType(typeRef.
TypeId
),
696
AtsTypeCategory.Dto => MapDtoType(typeRef.
TypeId
),
724
if (typeRef.
TypeId
== AtsConstants.ReferenceExpressionTypeId)
731
AtsTypeCategory.Primitive => MapPrimitiveType(typeRef.
TypeId
),
732
AtsTypeCategory.Enum => MapEnumType(typeRef.
TypeId
),
735
AtsTypeCategory.Dto => MapDtoType(typeRef.
TypeId
),
783
var baseType = typeRef.
TypeId
switch
807
&& typeRef.
TypeId
!= AtsConstants.ReferenceExpressionTypeId;
810
parameter.Type?.
TypeId
== AtsConstants.CancellationToken;
820
if (typeRef.
TypeId
== AtsConstants.ReferenceExpressionTypeId)
827
handleTypeIds.Add(typeRef.
TypeId
);
842
typeIds.Add(typeRef.
TypeId
);
Aspire.Hosting.CodeGeneration.Rust.Tests (2)
AtsRustCodeGeneratorTests.cs (2)
82
Assert.Contains(addTestRedis.Parameters, p => p.Name == "name" && p.Type?.
TypeId
== "string");
200
.Any(i => i.
TypeId
.Contains("IResourceWithEnvironment"));
Aspire.Hosting.CodeGeneration.TypeScript (32)
AtsTypeScriptCodeGenerator.cs (32)
138
if (_wrapperClassNames.TryGetValue(typeRef.
TypeId
, out var wrapperClassName))
145
AtsTypeCategory.Primitive => MapPrimitiveType(typeRef.
TypeId
),
146
AtsTypeCategory.Enum => MapEnumType(typeRef.
TypeId
),
147
AtsTypeCategory.Handle => GetWrapperOrHandleName(typeRef.
TypeId
),
148
AtsTypeCategory.Dto => GetDtoInterfaceName(typeRef.
TypeId
),
273
private static string? GetReturnTypeId(AtsCapabilityInfo capability) => capability.ReturnType?.
TypeId
;
376
if (IsHandleType(cap.ReturnType) && !dtoTypeIds.Contains(cap.ReturnType!.
TypeId
))
383
if (IsHandleType(param.Type) && !dtoTypeIds.Contains(param.Type!.
TypeId
))
385
typeIds.Add(param.Type!.
TypeId
);
392
if (IsHandleType(cbParam.Type) && !dtoTypeIds.Contains(cbParam.Type.
TypeId
))
394
typeIds.Add(cbParam.Type.
TypeId
);
1162
var returnType = callbackReturnType == null || callbackReturnType.
TypeId
== AtsConstants.Void
1220
return param.Type?.
TypeId
== AtsConstants.CancellationToken;
1251
&& callbackParam.CallbackReturnType.
TypeId
!= AtsConstants.Void;
1264
var cbTypeId = cbParam.Type.
TypeId
;
1294
var cbTypeId = cbParam.Type.
TypeId
;
1624
if (getter.ReturnType?.
TypeId
!= null && _wrapperClassNames.TryGetValue(getter.ReturnType.
TypeId
, out var wrapperClassName))
1675
var handleType = GetHandleTypeName(getter.ReturnType!.
TypeId
);
2003
var isVoid = capability.ReturnType == null || capability.ReturnType.
TypeId
== AtsConstants.Void;
2014
var returnWrapperClass = _wrapperClassNames.GetValueOrDefault(capability.ReturnType!.
TypeId
)
2015
?? DeriveClassName(capability.ReturnType.
TypeId
);
2016
var returnHandleType = GetHandleTypeName(capability.ReturnType.
TypeId
);
2200
var isVoid = capability.ReturnType == null || capability.ReturnType.
TypeId
== AtsConstants.Void;
2292
if (!capabilitiesByTypeId.TryGetValue(expandedType.
TypeId
, out var list))
2295
capabilitiesByTypeId[expandedType.
TypeId
] = list;
2297
typeRefsByTypeId[expandedType.
TypeId
] = expandedType;
2449
if (!string.IsNullOrEmpty(typeRef.
TypeId
) && typeRef.Category == AtsTypeCategory.Handle)
2451
typeRefs.TryAdd(typeRef.
TypeId
, typeRef);
2578
if (_typesWithPromiseWrappers.Contains(returnType.
TypeId
))
2580
var className = _wrapperClassNames.GetValueOrDefault(returnType.
TypeId
)
2581
?? DeriveClassName(returnType.
TypeId
);
Aspire.Hosting.CodeGeneration.TypeScript.Tests (28)
AtsTypeScriptCodeGeneratorTests.cs (28)
94
Assert.Contains(addTestRedis.Parameters, p => p.Name == "name" && p.Type?.
TypeId
== "string");
131
Assert.Equal("string", nameGetterCapability.ReturnType?.
TypeId
);
141
Assert.Equal("Aspire.Hosting.CodeGeneration.TypeScript.Tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests.TestTypes.TestCallbackContext", nameSetterCapability.ReturnType?.
TypeId
); // Returns context for fluent chaining
149
Assert.Equal("number", valueGetterCapability.ReturnType?.
TypeId
);
232
t.
TypeId
== "Aspire.Hosting.CodeGeneration.TypeScript.Tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests.TestTypes.TestRedisResource");
344
c.ExpandedTargetTypes.Any(t => t.
TypeId
.Contains("ContainerResource")))
349
TargetType = c.TargetType != null ? new { c.TargetType.
TypeId
, c.TargetType.IsInterface } : null,
351
.Where(t => t.
TypeId
.Contains("ContainerResource"))
352
.Select(t => new { t.
TypeId
, t.IsInterface })
392
if (expandedType.
TypeId
.Contains("ContainerResource"))
395
$"Capability '{cap.CapabilityId}' ExpandedTargetType '{expandedType.
TypeId
}' has IsInterface = true");
418
Assert.Equal("Aspire.Hosting/Aspire.Hosting.ApplicationModel.ContainerResource", withBindMount.TargetType.
TypeId
);
447
Assert.Contains("IResourceWithConnectionString", withConnectionStringDirect.TargetType.
TypeId
);
455
.FirstOrDefault(t => t.
TypeId
.Contains("TestRedisResource"));
475
Assert.Contains("TestRedisResource", withRedisSpecific.TargetType.
TypeId
);
483
.FirstOrDefault(t => t.
TypeId
.Contains("TestRedisResource"));
501
Assert.Contains("ContainerResource", withBindMount.TargetType.
TypeId
);
509
.FirstOrDefault(t => t.
TypeId
.Contains("ContainerResource") && !t.
TypeId
.Contains("IContainer"));
607
$"Expanded type '{expandedType.
TypeId
}' should be a concrete type, not an interface");
631
Assert.Contains("IResourceWithEnvironment", testWithEnvironmentCallback.TargetType.
TypeId
);
640
.FirstOrDefault(t => t.
TypeId
.Contains("TestRedisResource"));
744
.Any(i => i.
TypeId
.Contains("IResourceWithEnvironment"));
894
Assert.Equal("any", valueParam.Type.
TypeId
);
1018
Assert.Equal(AtsConstants.CancellationToken, ctParam.Type.
TypeId
);
1051
Assert.Equal(AtsConstants.CancellationToken, operationParam.CallbackParameters[0].Type?.
TypeId
);
1070
Assert.Equal(AtsConstants.TimeSpan, timeoutParam.Type?.
TypeId
);
1074
Assert.Equal(AtsConstants.CancellationToken, ctParam.Type?.
TypeId
);
Aspire.Hosting.RemoteHost (5)
Ats\AtsMarshaller.cs (4)
128
if (typeRef.
TypeId
== Hosting.Ats.AtsConstants.Any)
135
Hosting.Ats.AtsTypeCategory.Handle => _handles.Marshal(value, typeRef.
TypeId
),
140
Hosting.Ats.AtsTypeCategory.List => _handles.Marshal(value, typeRef.
TypeId
),
141
Hosting.Ats.AtsTypeCategory.Dict => _handles.Marshal(value, typeRef.
TypeId
),
CodeGeneration\CodeGenerationService.cs (1)
97
TypeId = t.
TypeId
,