32 writes to TypeId
Aspire.Hosting (31)
Ats\AtsCapabilityScanner.cs (31)
753TypeId = originalTarget, 783TypeId = typeInfo.AtsTypeId, 1080: new AtsTypeRef { TypeId = AtsConstants.Any, Category = AtsTypeCategory.Primitive }; 1084TypeId = AtsConstants.DictTypeId(keyTypeRef.TypeId, valueTypeRef.TypeId), 1107propertyTypeRef = new AtsTypeRef { TypeId = AtsConstants.Any, Category = AtsTypeCategory.Primitive }; 1126TypeId = typeId, 1232TypeId = typeId, 1547? new AtsTypeRef { TypeId = "callback", Category = AtsTypeCategory.Callback } 1600returnTypeRef = new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive }; 1604returnTypeRef = new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive }; 1612?? new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive } 1613: new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive }; 1618?? new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive }; 1644var voidTypeRef = new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive }; 1961TypeId = AtsConstants.Void, 2028return new AtsTypeRef { TypeId = primitiveTypeId, ClrType = type, Category = AtsTypeCategory.Primitive }; 2034return new AtsTypeRef { TypeId = AtsConstants.Any, ClrType = type, Category = AtsTypeCategory.Primitive }; 2045TypeId = AtsConstants.EnumTypeId(type.FullName ?? type.Name), 2068TypeId = AtsConstants.DictTypeId(keyTypeRef.TypeId, valueTypeRef.TypeId), 2091TypeId = AtsConstants.DictTypeId(keyTypeRef.TypeId, valueTypeRef.TypeId), 2113TypeId = AtsConstants.ListTypeId(elementTypeRef.TypeId), 2133TypeId = AtsConstants.ArrayTypeId(elementTypeRef.TypeId), 2161TypeId = constraintTypeId, 2172TypeId = typeId, 2192TypeId = AtsConstants.ArrayTypeId(elementTypeRef.TypeId), 2208TypeId = AtsTypeMapping.DeriveTypeId(type), 2220TypeId = AtsTypeMapping.DeriveTypeId(type), 2230TypeId = AtsTypeMapping.DeriveTypeId(type), 2310TypeId = ifaceTypeId, 2345TypeId = baseTypeId, 2604TypeId = string.Join("|", unionTypes.Select(u => u.TypeId)),
Aspire.Hosting.RemoteHost.Tests (1)
AtsMarshallerTests.cs (1)
682var typeRef = new AtsTypeRef { TypeId = "test/SelfReferencingDto", Category = AtsTypeCategory.Dto };
179 references to TypeId
Aspire.Hosting (20)
Ats\AtsCapabilityScanner.cs (20)
540enumTypes.TryAdd(typeRef.TypeId, typeRef.ClrType); 592if (typeRef.Category == AtsTypeCategory.Unknown && validTypes.Contains(typeRef.TypeId)) 689return typeRef.TypeId; 796AddToCompatibilityMap(typeToCompatibleTypes, iface.TypeId, concreteTypeRef); 802AddToCompatibilityMap(typeToCompatibleTypes, baseType.TypeId, concreteTypeRef); 835.SelectMany(c => c.ExpandedTargetTypes.Select(t => (Target: t.TypeId, Capability: c))) 1084TypeId = AtsConstants.DictTypeId(keyTypeRef.TypeId, valueTypeRef.TypeId), 1090propertyTypeId = propertyTypeRef.TypeId; 1103propertyTypeId = propertyTypeRef.TypeId; 1108propertyTypeId = propertyTypeRef.TypeId; 1435var firstParamTypeId = extendsTypeRef?.TypeId ?? MapToAtsTypeId(firstParamType); 2068TypeId = AtsConstants.DictTypeId(keyTypeRef.TypeId, valueTypeRef.TypeId), 2091TypeId = AtsConstants.DictTypeId(keyTypeRef.TypeId, valueTypeRef.TypeId), 2113TypeId = AtsConstants.ListTypeId(elementTypeRef.TypeId), 2133TypeId = AtsConstants.ArrayTypeId(elementTypeRef.TypeId), 2192TypeId = AtsConstants.ArrayTypeId(elementTypeRef.TypeId), 2604TypeId = string.Join("|", unionTypes.Select(u => u.TypeId)),
Aspire.Hosting.CodeGeneration.Go (15)
AtsGoCodeGenerator.cs (15)
296var hasReturn = capability.ReturnType.TypeId != AtsConstants.Void; 611if (targetType.TypeId is null) 616if (!result.TryGetValue(targetType.TypeId, out var list)) 619result[targetType.TypeId] = list; 661if (typeRef.TypeId == AtsConstants.ReferenceExpressionTypeId) 668AtsTypeCategory.Primitive => MapPrimitiveType(typeRef.TypeId), 669AtsTypeCategory.Enum => MapEnumType(typeRef.TypeId), 670AtsTypeCategory.Handle => "*" + MapHandleType(typeRef.TypeId), 671AtsTypeCategory.Dto => "*" + MapDtoType(typeRef.TypeId), 714IsCancellationTokenTypeId(parameter.Type?.TypeId); 728if (typeRef.TypeId == AtsConstants.ReferenceExpressionTypeId 729|| IsCancellationTokenTypeId(typeRef.TypeId)) 736handleTypeIds.Add(typeRef.TypeId); 751typeIds[typeRef.TypeId] = false; // false = List 758typeIds[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 (15)
AtsJavaCodeGenerator.cs (15)
276var hasReturn = capability.ReturnType.TypeId != AtsConstants.Void; 578if (targetType.TypeId is null) 583if (!result.TryGetValue(targetType.TypeId, out var list)) 586result[targetType.TypeId] = list; 626if (typeRef.TypeId == AtsConstants.ReferenceExpressionTypeId) 633AtsTypeCategory.Primitive => MapPrimitiveType(typeRef.TypeId, isOptional), 634AtsTypeCategory.Enum => MapEnumType(typeRef.TypeId), 635AtsTypeCategory.Handle => MapHandleType(typeRef.TypeId), 636AtsTypeCategory.Dto => MapDtoType(typeRef.TypeId), 678IsCancellationTokenTypeId(parameter.Type?.TypeId); 692if (typeRef.TypeId == AtsConstants.ReferenceExpressionTypeId 693|| IsCancellationTokenTypeId(typeRef.TypeId)) 700handleTypeIds.Add(typeRef.TypeId); 715typeIds[typeRef.TypeId] = false; // false = List 722typeIds[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) 483if (targetType.TypeId is null) 488if (!result.TryGetValue(targetType.TypeId, out var list)) 491result[targetType.TypeId] = list; 577if (typeRef.TypeId == AtsConstants.ReferenceExpressionTypeId) 584AtsTypeCategory.Primitive => MapPrimitiveType(typeRef.TypeId), 585AtsTypeCategory.Enum => MapEnumType(typeRef.TypeId), 586AtsTypeCategory.Handle => MapHandleType(typeRef.TypeId), 587AtsTypeCategory.Dto => MapDtoType(typeRef.TypeId), 652parameter.Type?.TypeId == AtsConstants.CancellationToken; 663handleTypeIds.Add(typeRef.TypeId); 678typeIds[typeRef.TypeId] = false; // false = List 685typeIds[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 (23)
AtsRustCodeGenerator.cs (23)
322var hasReturn = capability.ReturnType.TypeId != AtsConstants.Void; 455var wrappedType = MapHandleType(returnTypeRef.TypeId); 459else if (returnTypeRef?.TypeId == AtsConstants.CancellationToken) 686if (targetType.TypeId is null) 691if (!result.TryGetValue(targetType.TypeId, out var list)) 694result[targetType.TypeId] = list; 733if (typeRef.TypeId == AtsConstants.ReferenceExpressionTypeId) 740AtsTypeCategory.Primitive => MapPrimitiveType(typeRef.TypeId), 741AtsTypeCategory.Enum => MapEnumType(typeRef.TypeId), 742AtsTypeCategory.Handle => MapHandleType(typeRef.TypeId), 743AtsTypeCategory.Dto => MapDtoType(typeRef.TypeId), 771if (typeRef.TypeId == AtsConstants.ReferenceExpressionTypeId) 778AtsTypeCategory.Primitive => MapPrimitiveType(typeRef.TypeId), 779AtsTypeCategory.Enum => MapEnumType(typeRef.TypeId), 782AtsTypeCategory.Dto => MapDtoType(typeRef.TypeId), 830var baseType = typeRef.TypeId switch 854&& typeRef.TypeId != AtsConstants.ReferenceExpressionTypeId 855&& !IsCancellationTokenTypeId(typeRef.TypeId); 869IsCancellationTokenTypeId(parameter.Type?.TypeId); 883if (typeRef.TypeId == AtsConstants.ReferenceExpressionTypeId 884|| IsCancellationTokenTypeId(typeRef.TypeId)) 891handleTypeIds.Add(typeRef.TypeId); 906typeIds.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 (48)
AtsTypeScriptCodeGenerator.cs (48)
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), 284private static string? GetReturnTypeId(AtsCapabilityInfo capability) => capability.ReturnType?.TypeId; 388if (IsHandleType(cap.ReturnType) && !dtoTypeIds.Contains(cap.ReturnType!.TypeId)) 395if (IsHandleType(param.Type) && !dtoTypeIds.Contains(param.Type!.TypeId)) 397typeIds.Add(param.Type!.TypeId); 404if (IsHandleType(cbParam.Type) && !dtoTypeIds.Contains(cbParam.Type.TypeId)) 406typeIds.Add(cbParam.Type.TypeId); 799var aTypeId = a.Type?.TypeId; 800var bTypeId = b.Type?.TypeId; 824if (!string.Equals(aCallbackParams[i].Type.TypeId, bCallbackParams[i].Type.TypeId, StringComparison.Ordinal)) 831var aReturnTypeId = a.CallbackReturnType?.TypeId; 832var bReturnTypeId = b.CallbackReturnType?.TypeId; 967if (capability.ReturnsBuilder && capability.ReturnType?.TypeId != null && 968!string.Equals(capability.ReturnType.TypeId, builder.TypeId, StringComparison.Ordinal) && 969!string.Equals(capability.ReturnType.TypeId, capability.TargetTypeId, StringComparison.Ordinal)) 971returnTypeId = capability.ReturnType.TypeId; 1226if (capability.ReturnsBuilder && capability.ReturnType?.TypeId != null && 1227!string.Equals(capability.ReturnType.TypeId, builder.TypeId, StringComparison.Ordinal) && 1228!string.Equals(capability.ReturnType.TypeId, capability.TargetTypeId, StringComparison.Ordinal)) 1230var returnClass = _wrapperClassNames.GetValueOrDefault(capability.ReturnType.TypeId) 1231?? DeriveClassName(capability.ReturnType.TypeId); 1364var returnType = callbackReturnType == null || callbackReturnType.TypeId == AtsConstants.Void 1422return param.Type?.TypeId == AtsConstants.CancellationToken; 1453&& callbackParam.CallbackReturnType.TypeId != AtsConstants.Void; 1466var cbTypeId = cbParam.Type.TypeId; 1496var cbTypeId = cbParam.Type.TypeId; 1832if (getter.ReturnType?.TypeId != null && _wrapperClassNames.TryGetValue(getter.ReturnType.TypeId, out var wrapperClassName)) 1883var handleType = GetHandleTypeName(getter.ReturnType!.TypeId); 2211var isVoid = capability.ReturnType == null || capability.ReturnType.TypeId == AtsConstants.Void; 2222var returnWrapperClass = _wrapperClassNames.GetValueOrDefault(capability.ReturnType!.TypeId) 2223?? DeriveClassName(capability.ReturnType.TypeId); 2224var returnHandleType = GetHandleTypeName(capability.ReturnType.TypeId); 2408var isVoid = capability.ReturnType == null || capability.ReturnType.TypeId == AtsConstants.Void; 2507if (!capabilitiesByTypeId.TryGetValue(expandedType.TypeId, out var list)) 2510capabilitiesByTypeId[expandedType.TypeId] = list; 2512typeRefsByTypeId[expandedType.TypeId] = expandedType; 2669if (!string.IsNullOrEmpty(typeRef.TypeId) && typeRef.Category == AtsTypeCategory.Handle) 2671typeRefs.TryAdd(typeRef.TypeId, typeRef); 2798if (_typesWithPromiseWrappers.Contains(returnType.TypeId)) 2800var className = _wrapperClassNames.GetValueOrDefault(returnType.TypeId) 2801?? DeriveClassName(returnType.TypeId);
Aspire.Hosting.CodeGeneration.TypeScript.Tests (30)
AtsTypeScriptCodeGeneratorTests.cs (30)
105Assert.Contains(addTestRedis.Parameters, p => p.Name == "name" && p.Type?.TypeId == "string"); 142Assert.Equal("string", nameGetterCapability.ReturnType?.TypeId); 152Assert.Equal("Aspire.Hosting.CodeGeneration.TypeScript.Tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests.TestTypes.TestCallbackContext", nameSetterCapability.ReturnType?.TypeId); // Returns context for fluent chaining 160Assert.Equal("number", valueGetterCapability.ReturnType?.TypeId); 243t.TypeId == "Aspire.Hosting.CodeGeneration.TypeScript.Tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests.TestTypes.TestRedisResource"); 380c.ExpandedTargetTypes.Any(t => t.TypeId.Contains("ContainerResource"))) 385TargetType = c.TargetType != null ? new { c.TargetType.TypeId, c.TargetType.IsInterface } : null, 387.Where(t => t.TypeId.Contains("ContainerResource")) 388.Select(t => new { t.TypeId, t.IsInterface }) 428if (expandedType.TypeId.Contains("ContainerResource")) 431$"Capability '{cap.CapabilityId}' ExpandedTargetType '{expandedType.TypeId}' has IsInterface = true"); 454Assert.Equal("Aspire.Hosting/Aspire.Hosting.ApplicationModel.ContainerResource", withBindMount.TargetType.TypeId); 483Assert.Contains("IResourceWithConnectionString", withConnectionStringDirect.TargetType.TypeId); 491.FirstOrDefault(t => t.TypeId.Contains("TestRedisResource")); 511Assert.Contains("TestRedisResource", withRedisSpecific.TargetType.TypeId); 519.FirstOrDefault(t => t.TypeId.Contains("TestRedisResource")); 537Assert.Contains("ContainerResource", withBindMount.TargetType.TypeId); 545.FirstOrDefault(t => t.TypeId.Contains("ContainerResource") && !t.TypeId.Contains("IContainer")); 643$"Expanded type '{expandedType.TypeId}' should be a concrete type, not an interface"); 667Assert.Contains("IResourceWithEnvironment", testWithEnvironmentCallback.TargetType.TypeId); 676.FirstOrDefault(t => t.TypeId.Contains("TestRedisResource")); 780.Any(i => i.TypeId.Contains("IResourceWithEnvironment")); 930Assert.Equal("any", valueParam.Type.TypeId); 1067Assert.Equal(AtsConstants.CancellationToken, ctParam.Type.TypeId); 1100Assert.Equal(AtsConstants.CancellationToken, operationParam.CallbackParameters[0].Type?.TypeId); 1119Assert.Equal(AtsConstants.TimeSpan, timeoutParam.Type?.TypeId); 1123Assert.Equal(AtsConstants.CancellationToken, ctParam.Type?.TypeId); 1365var expandedTypeIds = withNpm.ExpandedTargetTypes.Select(t => t.TypeId).ToList(); 1396var expandedTypeIds = capability.ExpandedTargetTypes.Select(t => t.TypeId).ToList();
Aspire.Hosting.RemoteHost (5)
Ats\AtsMarshaller.cs (4)
139if (typeRef.TypeId == Hosting.Ats.AtsConstants.Any) 146Hosting.Ats.AtsTypeCategory.Handle => _handles.Marshal(value, typeRef.TypeId), 151Hosting.Ats.AtsTypeCategory.List => _handles.Marshal(value, typeRef.TypeId), 152Hosting.Ats.AtsTypeCategory.Dict => _handles.Marshal(value, typeRef.TypeId),
CodeGeneration\CodeGenerationService.cs (1)
97TypeId = t.TypeId,
Aspire.Hosting.Tests (2)
Ats\AtsCapabilityScannerTests.cs (2)
138Assert.Equal("string[]", itemsType.TypeId); 143Assert.Equal("string[]", enumerableReturnCapability.ReturnType.TypeId);