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