33 writes to TypeId
Aspire.Hosting.RemoteHost (31)
AtsCapabilityScanner.cs (31)
764TypeId = originalTarget, 794TypeId = typeInfo.AtsTypeId, 1100: new AtsTypeRef { TypeId = AtsConstants.Any, Category = AtsTypeCategory.Primitive }; 1104TypeId = AtsConstants.DictTypeId(keyTypeRef.TypeId, valueTypeRef.TypeId), 1127propertyTypeRef = new AtsTypeRef { TypeId = AtsConstants.Any, Category = AtsTypeCategory.Primitive }; 1146TypeId = typeId, 1252TypeId = typeId, 1569? new AtsTypeRef { TypeId = "callback", Category = AtsTypeCategory.Callback } 1623returnTypeRef = new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive }; 1627returnTypeRef = new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive }; 1635?? new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive } 1636: new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive }; 1641?? new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive } 1669var voidTypeRef = new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive }; 1988TypeId = AtsConstants.Void, 2056return new AtsTypeRef { TypeId = primitiveTypeId, ClrType = type, Category = AtsTypeCategory.Primitive }; 2062return new AtsTypeRef { TypeId = AtsConstants.Any, ClrType = type, Category = AtsTypeCategory.Primitive }; 2073TypeId = AtsConstants.EnumTypeId(type.FullName ?? type.Name), 2096TypeId = AtsConstants.DictTypeId(keyTypeRef.TypeId, valueTypeRef.TypeId), 2119TypeId = AtsConstants.DictTypeId(keyTypeRef.TypeId, valueTypeRef.TypeId), 2141TypeId = AtsConstants.ListTypeId(elementTypeRef.TypeId), 2161TypeId = AtsConstants.ArrayTypeId(elementTypeRef.TypeId), 2189TypeId = constraintTypeId, 2200TypeId = typeId, 2220TypeId = AtsConstants.ArrayTypeId(elementTypeRef.TypeId), 2236TypeId = AtsTypeMapping.DeriveTypeId(type), 2248TypeId = AtsTypeMapping.DeriveTypeId(type), 2258TypeId = AtsTypeMapping.DeriveTypeId(type), 2338TypeId = ifaceTypeId, 2373TypeId = baseTypeId, 2633TypeId = string.Join("|", unionTypes.Select(u => u.TypeId)),
Aspire.Hosting.RemoteHost.Tests (2)
AtsMarshallerTests.cs (2)
192TypeId = AtsConstants.CancellationToken, 730var typeRef = new AtsTypeRef { TypeId = "test/SelfReferencingDto", Category = AtsTypeCategory.Dto };
186 references to TypeId
Aspire.Hosting.CodeGeneration.Go (15)
AtsGoCodeGenerator.cs (15)
295var hasReturn = capability.ReturnType.TypeId != AtsConstants.Void; 606if (targetType.TypeId is null) 611if (!result.TryGetValue(targetType.TypeId, out var list)) 614result[targetType.TypeId] = list; 656if (typeRef.TypeId == AtsConstants.ReferenceExpressionTypeId) 663AtsTypeCategory.Primitive => MapPrimitiveType(typeRef.TypeId), 664AtsTypeCategory.Enum => MapEnumType(typeRef.TypeId), 665AtsTypeCategory.Handle => "*" + MapHandleType(typeRef.TypeId), 666AtsTypeCategory.Dto => "*" + MapDtoType(typeRef.TypeId), 720IsCancellationTokenTypeId(parameter.Type?.TypeId); 734if (typeRef.TypeId == AtsConstants.ReferenceExpressionTypeId 735|| IsCancellationTokenTypeId(typeRef.TypeId)) 742handleTypeIds.Add(typeRef.TypeId); 757typeIds[typeRef.TypeId] = false; // false = List 764typeIds[typeRef.TypeId] = true; // true = Dict
Aspire.Hosting.CodeGeneration.Go.Tests (2)
AtsGoCodeGeneratorTests.cs (2)
83Assert.Contains(addTestRedis.Parameters, p => p.Name == "name" && p.Type?.TypeId == "string"); 201.Any(i => i.TypeId.Contains("IResourceWithEnvironment"));
Aspire.Hosting.CodeGeneration.Java (15)
AtsJavaCodeGenerator.cs (15)
275var hasReturn = capability.ReturnType.TypeId != AtsConstants.Void; 576if (targetType.TypeId is null) 581if (!result.TryGetValue(targetType.TypeId, out var list)) 584result[targetType.TypeId] = list; 624if (typeRef.TypeId == AtsConstants.ReferenceExpressionTypeId) 631AtsTypeCategory.Primitive => MapPrimitiveType(typeRef.TypeId, isOptional), 632AtsTypeCategory.Enum => MapEnumType(typeRef.TypeId), 633AtsTypeCategory.Handle => MapHandleType(typeRef.TypeId), 634AtsTypeCategory.Dto => MapDtoType(typeRef.TypeId), 676IsCancellationTokenTypeId(parameter.Type?.TypeId); 690if (typeRef.TypeId == AtsConstants.ReferenceExpressionTypeId 691|| IsCancellationTokenTypeId(typeRef.TypeId)) 698handleTypeIds.Add(typeRef.TypeId); 713typeIds[typeRef.TypeId] = false; // false = List 720typeIds[typeRef.TypeId] = true; // true = Dict
Aspire.Hosting.CodeGeneration.Java.Tests (2)
AtsJavaCodeGeneratorTests.cs (2)
82Assert.Contains(addTestRedis.Parameters, p => p.Name == "name" && p.Type?.TypeId == "string"); 200.Any(i => i.TypeId.Contains("IResourceWithEnvironment"));
Aspire.Hosting.CodeGeneration.Python (13)
AtsPythonCodeGenerator.cs (13)
289if (capability.ReturnType.TypeId == AtsConstants.Void) 481if (targetType.TypeId is null) 486if (!result.TryGetValue(targetType.TypeId, out var list)) 489result[targetType.TypeId] = list; 575if (typeRef.TypeId == AtsConstants.ReferenceExpressionTypeId) 582AtsTypeCategory.Primitive => MapPrimitiveType(typeRef.TypeId), 583AtsTypeCategory.Enum => MapEnumType(typeRef.TypeId), 584AtsTypeCategory.Handle => MapHandleType(typeRef.TypeId), 585AtsTypeCategory.Dto => MapDtoType(typeRef.TypeId), 650parameter.Type?.TypeId == AtsConstants.CancellationToken; 661handleTypeIds.Add(typeRef.TypeId); 676typeIds[typeRef.TypeId] = false; // false = List 683typeIds[typeRef.TypeId] = true; // true = Dict
Aspire.Hosting.CodeGeneration.Python.Tests (2)
AtsPythonCodeGeneratorTests.cs (2)
83Assert.Contains(addTestRedis.Parameters, p => p.Name == "name" && p.Type?.TypeId == "string"); 201.Any(i => i.TypeId.Contains("IResourceWithEnvironment"));
Aspire.Hosting.CodeGeneration.Rust (23)
AtsRustCodeGenerator.cs (23)
321var hasReturn = capability.ReturnType.TypeId != AtsConstants.Void; 454var wrappedType = MapHandleType(returnTypeRef.TypeId); 458else if (returnTypeRef?.TypeId == AtsConstants.CancellationToken) 684if (targetType.TypeId is null) 689if (!result.TryGetValue(targetType.TypeId, out var list)) 692result[targetType.TypeId] = list; 731if (typeRef.TypeId == AtsConstants.ReferenceExpressionTypeId) 738AtsTypeCategory.Primitive => MapPrimitiveType(typeRef.TypeId), 739AtsTypeCategory.Enum => MapEnumType(typeRef.TypeId), 740AtsTypeCategory.Handle => MapHandleType(typeRef.TypeId), 741AtsTypeCategory.Dto => MapDtoType(typeRef.TypeId), 769if (typeRef.TypeId == AtsConstants.ReferenceExpressionTypeId) 776AtsTypeCategory.Primitive => MapPrimitiveType(typeRef.TypeId), 777AtsTypeCategory.Enum => MapEnumType(typeRef.TypeId), 780AtsTypeCategory.Dto => MapDtoType(typeRef.TypeId), 828var baseType = typeRef.TypeId switch 852&& typeRef.TypeId != AtsConstants.ReferenceExpressionTypeId 853&& !IsCancellationTokenTypeId(typeRef.TypeId); 867IsCancellationTokenTypeId(parameter.Type?.TypeId); 881if (typeRef.TypeId == AtsConstants.ReferenceExpressionTypeId 882|| IsCancellationTokenTypeId(typeRef.TypeId)) 889handleTypeIds.Add(typeRef.TypeId); 904typeIds.Add(typeRef.TypeId);
Aspire.Hosting.CodeGeneration.Rust.Tests (2)
AtsRustCodeGeneratorTests.cs (2)
83Assert.Contains(addTestRedis.Parameters, p => p.Name == "name" && p.Type?.TypeId == "string"); 201.Any(i => i.TypeId.Contains("IResourceWithEnvironment"));
Aspire.Hosting.CodeGeneration.TypeScript (53)
AtsTypeScriptCodeGenerator.cs (53)
143if (_wrapperClassNames.TryGetValue(typeRef.TypeId, out var wrapperClassName)) 149if (typeRef.TypeId == AtsConstants.ReferenceExpressionTypeId) 156AtsTypeCategory.Primitive => MapPrimitiveType(typeRef.TypeId), 157AtsTypeCategory.Enum => MapEnumType(typeRef.TypeId), 158AtsTypeCategory.Handle => GetWrapperOrHandleName(typeRef.TypeId), 159AtsTypeCategory.Dto => GetDtoInterfaceName(typeRef.TypeId), 291private static bool IsCancellationTokenType(AtsTypeRef? typeRef) => typeRef?.TypeId == AtsConstants.CancellationToken; 329private static string? GetReturnTypeId(AtsCapabilityInfo capability) => capability.ReturnType?.TypeId; 434if (IsHandleType(cap.ReturnType) && !dtoTypeIds.Contains(cap.ReturnType!.TypeId)) 441if (IsHandleType(param.Type) && !dtoTypeIds.Contains(param.Type!.TypeId)) 443typeIds.Add(param.Type!.TypeId); 450if (IsHandleType(cbParam.Type) && !dtoTypeIds.Contains(cbParam.Type.TypeId)) 452typeIds.Add(cbParam.Type.TypeId); 845var aTypeId = a.Type?.TypeId; 846var bTypeId = b.Type?.TypeId; 870if (!string.Equals(aCallbackParams[i].Type.TypeId, bCallbackParams[i].Type.TypeId, StringComparison.Ordinal)) 877var aReturnTypeId = a.CallbackReturnType?.TypeId; 878var bReturnTypeId = b.CallbackReturnType?.TypeId; 1013if (capability.ReturnsBuilder && capability.ReturnType?.TypeId != null && 1014!string.Equals(capability.ReturnType.TypeId, builder.TypeId, StringComparison.Ordinal) && 1015!string.Equals(capability.ReturnType.TypeId, capability.TargetTypeId, StringComparison.Ordinal)) 1017returnTypeId = capability.ReturnType.TypeId; 1057if (capability.ReturnType?.TypeId == AtsConstants.CancellationToken) 1250if (capability.ReturnsBuilder && capability.ReturnType?.TypeId != null && 1251!string.Equals(capability.ReturnType.TypeId, builder.TypeId, StringComparison.Ordinal) && 1252!string.Equals(capability.ReturnType.TypeId, capability.TargetTypeId, StringComparison.Ordinal)) 1254var returnClass = _wrapperClassNames.GetValueOrDefault(capability.ReturnType.TypeId) 1255?? DeriveClassName(capability.ReturnType.TypeId); 1371else if (capability.ReturnType?.TypeId == AtsConstants.CancellationToken) 1410var returnType = callbackReturnType == null || callbackReturnType.TypeId == AtsConstants.Void 1472&& callbackParam.CallbackReturnType.TypeId != AtsConstants.Void; 1485var cbTypeId = cbParam.Type.TypeId; 1513var cbTypeId = cbParam.Type.TypeId; 1854if (getter.ReturnType?.TypeId != null && _wrapperClassNames.TryGetValue(getter.ReturnType.TypeId, out var wrapperClassName)) 1873if (getter.ReturnType?.TypeId == AtsConstants.CancellationToken) 1916var handleType = GetHandleTypeName(getter.ReturnType!.TypeId); 2104else if (method.ReturnType?.TypeId == AtsConstants.CancellationToken) 2255var isVoid = capability.ReturnType == null || capability.ReturnType.TypeId == AtsConstants.Void; 2266var returnWrapperClass = _wrapperClassNames.GetValueOrDefault(capability.ReturnType!.TypeId) 2267?? DeriveClassName(capability.ReturnType.TypeId); 2268var returnHandleType = GetHandleTypeName(capability.ReturnType.TypeId); 2376if (capability.ReturnType?.TypeId == AtsConstants.CancellationToken) 2463var isVoid = capability.ReturnType == null || capability.ReturnType.TypeId == AtsConstants.Void; 2562if (!capabilitiesByTypeId.TryGetValue(expandedType.TypeId, out var list)) 2565capabilitiesByTypeId[expandedType.TypeId] = list; 2567typeRefsByTypeId[expandedType.TypeId] = expandedType; 2724if (!string.IsNullOrEmpty(typeRef.TypeId) && typeRef.Category == AtsTypeCategory.Handle) 2726typeRefs.TryAdd(typeRef.TypeId, typeRef); 2853if (_typesWithPromiseWrappers.Contains(returnType.TypeId)) 2855var className = _wrapperClassNames.GetValueOrDefault(returnType.TypeId) 2856?? DeriveClassName(returnType.TypeId);
Aspire.Hosting.CodeGeneration.TypeScript.Tests (30)
AtsTypeScriptCodeGeneratorTests.cs (30)
115Assert.Contains(addTestRedis.Parameters, p => p.Name == "name" && p.Type?.TypeId == "string"); 152Assert.Equal("string", nameGetterCapability.ReturnType?.TypeId); 162Assert.Equal("Aspire.Hosting.CodeGeneration.TypeScript.Tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests.TestTypes.TestCallbackContext", nameSetterCapability.ReturnType?.TypeId); // Returns context for fluent chaining 170Assert.Equal("number", valueGetterCapability.ReturnType?.TypeId); 253t.TypeId == "Aspire.Hosting.CodeGeneration.TypeScript.Tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests.TestTypes.TestRedisResource"); 390c.ExpandedTargetTypes.Any(t => t.TypeId.Contains("ContainerResource"))) 395TargetType = c.TargetType != null ? new { c.TargetType.TypeId, c.TargetType.IsInterface } : null, 397.Where(t => t.TypeId.Contains("ContainerResource")) 398.Select(t => new { t.TypeId, t.IsInterface }) 438if (expandedType.TypeId.Contains("ContainerResource")) 441$"Capability '{cap.CapabilityId}' ExpandedTargetType '{expandedType.TypeId}' has IsInterface = true"); 464Assert.Equal("Aspire.Hosting/Aspire.Hosting.ApplicationModel.ContainerResource", withBindMount.TargetType.TypeId); 493Assert.Contains("IResourceWithConnectionString", withConnectionStringDirect.TargetType.TypeId); 501.FirstOrDefault(t => t.TypeId.Contains("TestRedisResource")); 521Assert.Contains("TestRedisResource", withRedisSpecific.TargetType.TypeId); 529.FirstOrDefault(t => t.TypeId.Contains("TestRedisResource")); 547Assert.Contains("ContainerResource", withBindMount.TargetType.TypeId); 555.FirstOrDefault(t => t.TypeId.Contains("ContainerResource") && !t.TypeId.Contains("IContainer")); 653$"Expanded type '{expandedType.TypeId}' should be a concrete type, not an interface"); 677Assert.Contains("IResourceWithEnvironment", testWithEnvironmentCallback.TargetType.TypeId); 686.FirstOrDefault(t => t.TypeId.Contains("TestRedisResource")); 802.Any(i => i.TypeId.Contains("IResourceWithEnvironment")); 987Assert.Equal("any", valueParam.Type.TypeId); 1134Assert.Equal(AtsConstants.CancellationToken, ctParam.Type.TypeId); 1169Assert.Equal(AtsConstants.CancellationToken, operationParam.CallbackParameters[0].Type?.TypeId); 1188Assert.Equal(AtsConstants.TimeSpan, timeoutParam.Type?.TypeId); 1192Assert.Equal(AtsConstants.CancellationToken, ctParam.Type?.TypeId); 1419var expandedTypeIds = withNpm.ExpandedTargetTypes.Select(t => t.TypeId).ToList(); 1450var expandedTypeIds = capability.ExpandedTargetTypes.Select(t => t.TypeId).ToList();
Aspire.Hosting.RemoteHost (26)
Ats\AtsMarshaller.cs (5)
138if (typeRef.TypeId == AtsConstants.CancellationToken && value is CancellationToken cancellationToken) 144if (typeRef.TypeId == TypeSystem.AtsConstants.Any) 151AtsTypeCategory.Handle => _handles.Marshal(value, typeRef.TypeId), 156AtsTypeCategory.List => _handles.Marshal(value, typeRef.TypeId), 157AtsTypeCategory.Dict => _handles.Marshal(value, typeRef.TypeId),
AtsCapabilityScanner.cs (20)
551enumTypes.TryAdd(typeRef.TypeId, typeRef.ClrType); 603if (typeRef.Category == AtsTypeCategory.Unknown && validTypes.Contains(typeRef.TypeId)) 700return typeRef.TypeId; 807AddToCompatibilityMap(typeToCompatibleTypes, iface.TypeId, concreteTypeRef); 813AddToCompatibilityMap(typeToCompatibleTypes, baseType.TypeId, concreteTypeRef); 846.SelectMany(c => c.ExpandedTargetTypes.Select(t => (Target: t.TypeId, Capability: c))) 1104TypeId = AtsConstants.DictTypeId(keyTypeRef.TypeId, valueTypeRef.TypeId), 1110propertyTypeId = propertyTypeRef.TypeId; 1123propertyTypeId = propertyTypeRef.TypeId; 1128propertyTypeId = propertyTypeRef.TypeId; 1456var firstParamTypeId = extendsTypeRef?.TypeId ?? MapToAtsTypeId(firstParamType, assemblyExportedTypeCache); 2096TypeId = AtsConstants.DictTypeId(keyTypeRef.TypeId, valueTypeRef.TypeId), 2119TypeId = AtsConstants.DictTypeId(keyTypeRef.TypeId, valueTypeRef.TypeId), 2141TypeId = AtsConstants.ListTypeId(elementTypeRef.TypeId), 2161TypeId = AtsConstants.ArrayTypeId(elementTypeRef.TypeId), 2220TypeId = AtsConstants.ArrayTypeId(elementTypeRef.TypeId), 2633TypeId = string.Join("|", unionTypes.Select(u => u.TypeId)),
CodeGeneration\CodeGenerationService.cs (1)
97TypeId = t.TypeId,
Aspire.Hosting.RemoteHost.Tests (3)
AtsCapabilityScannerTests.cs (3)
141Assert.Equal("string[]", itemsType.TypeId); 146Assert.Equal("string[]", enumerableReturnCapability.ReturnType.TypeId); 348Assert.Equal(AtsTypeMapping.DeriveTypeId(typeof(AssemblyLevelExportedTestType)), parameter.Type.TypeId);