31 writes to TypeId
Aspire.Hosting (31)
Ats\AtsCapabilityScanner.cs (31)
691TypeId = originalTarget, 721TypeId = typeInfo.AtsTypeId, 977: new AtsTypeRef { TypeId = AtsConstants.Any, Category = AtsTypeCategory.Primitive }; 981TypeId = AtsConstants.DictTypeId(keyTypeRef.TypeId, valueTypeRef.TypeId), 1004propertyTypeRef = new AtsTypeRef { TypeId = AtsConstants.Any, Category = AtsTypeCategory.Primitive }; 1023TypeId = typeId, 1123TypeId = typeId, 1430? new AtsTypeRef { TypeId = "callback", Category = AtsTypeCategory.Callback } 1483returnTypeRef = new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive }; 1487returnTypeRef = new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive }; 1495?? new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive } 1496: new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive }; 1501?? new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive }; 1527var voidTypeRef = new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive }; 1828TypeId = AtsConstants.Void, 1878return new AtsTypeRef { TypeId = primitiveTypeId, ClrType = type, Category = AtsTypeCategory.Primitive }; 1884return new AtsTypeRef { TypeId = AtsConstants.Any, ClrType = type, Category = AtsTypeCategory.Primitive }; 1895TypeId = AtsConstants.EnumTypeId(type.FullName ?? type.Name), 1918TypeId = AtsConstants.DictTypeId(keyTypeRef.TypeId, valueTypeRef.TypeId), 1941TypeId = AtsConstants.DictTypeId(keyTypeRef.TypeId, valueTypeRef.TypeId), 1963TypeId = AtsConstants.ListTypeId(elementTypeRef.TypeId), 1983TypeId = AtsConstants.ArrayTypeId(elementTypeRef.TypeId), 2011TypeId = constraintTypeId, 2022TypeId = typeId, 2042TypeId = AtsConstants.ArrayTypeId(elementTypeRef.TypeId), 2058TypeId = AtsTypeMapping.DeriveTypeId(type), 2070TypeId = AtsTypeMapping.DeriveTypeId(type), 2080TypeId = AtsTypeMapping.DeriveTypeId(type), 2160TypeId = ifaceTypeId, 2195TypeId = baseTypeId, 2454TypeId = string.Join("|", unionTypes.Select(u => u.TypeId)),
84 references to TypeId
Aspire.Hosting (20)
Ats\AtsCapabilityScanner.cs (20)
491enumTypeIds.Add(typeRef.TypeId); 530if (typeRef.Category == AtsTypeCategory.Unknown && validTypes.Contains(typeRef.TypeId)) 627return typeRef.TypeId; 730AddToCompatibilityMap(typeToCompatibleTypes, iface.TypeId, concreteTypeRef); 736AddToCompatibilityMap(typeToCompatibleTypes, baseType.TypeId, concreteTypeRef); 769.SelectMany(c => c.ExpandedTargetTypes.Select(t => (Target: t.TypeId, Capability: c))) 981TypeId = AtsConstants.DictTypeId(keyTypeRef.TypeId, valueTypeRef.TypeId), 987propertyTypeId = propertyTypeRef.TypeId; 1000propertyTypeId = propertyTypeRef.TypeId; 1005propertyTypeId = propertyTypeRef.TypeId; 1321var firstParamTypeId = extendsTypeRef?.TypeId ?? MapToAtsTypeId(firstParamType); 1918TypeId = AtsConstants.DictTypeId(keyTypeRef.TypeId, valueTypeRef.TypeId), 1941TypeId = AtsConstants.DictTypeId(keyTypeRef.TypeId, valueTypeRef.TypeId), 1963TypeId = AtsConstants.ListTypeId(elementTypeRef.TypeId), 1983TypeId = AtsConstants.ArrayTypeId(elementTypeRef.TypeId), 2042TypeId = AtsConstants.ArrayTypeId(elementTypeRef.TypeId), 2454TypeId = string.Join("|", unionTypes.Select(u => u.TypeId)),
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); 1161var returnType = callbackReturnType == null || callbackReturnType.TypeId == AtsConstants.Void 1219return param.Type?.TypeId == AtsConstants.CancellationToken; 1250&& callbackParam.CallbackReturnType.TypeId != AtsConstants.Void; 1263var cbTypeId = cbParam.Type.TypeId; 1293var cbTypeId = cbParam.Type.TypeId; 1614if (getter.ReturnType?.TypeId != null && _wrapperClassNames.TryGetValue(getter.ReturnType.TypeId, out var wrapperClassName)) 1665var handleType = GetHandleTypeName(getter.ReturnType!.TypeId); 1947var isVoid = capability.ReturnType == null || capability.ReturnType.TypeId == AtsConstants.Void; 1958var returnWrapperClass = _wrapperClassNames.GetValueOrDefault(capability.ReturnType!.TypeId) 1959?? DeriveClassName(capability.ReturnType.TypeId); 1960var returnHandleType = GetHandleTypeName(capability.ReturnType.TypeId); 2144var isVoid = capability.ReturnType == null || capability.ReturnType.TypeId == AtsConstants.Void; 2236if (!capabilitiesByTypeId.TryGetValue(expandedType.TypeId, out var list)) 2239capabilitiesByTypeId[expandedType.TypeId] = list; 2241typeRefsByTypeId[expandedType.TypeId] = expandedType; 2393if (!string.IsNullOrEmpty(typeRef.TypeId) && typeRef.Category == AtsTypeCategory.Handle) 2395typeRefs.TryAdd(typeRef.TypeId, typeRef); 2522if (_typesWithPromiseWrappers.Contains(returnType.TypeId)) 2524var className = _wrapperClassNames.GetValueOrDefault(returnType.TypeId) 2525?? DeriveClassName(returnType.TypeId);
Aspire.Hosting.CodeGeneration.TypeScript.Tests (28)
AtsTypeScriptCodeGeneratorTests.cs (28)
122Assert.Contains(addTestRedis.Parameters, p => p.Name == "name" && p.Type?.TypeId == "string"); 159Assert.Equal("string", nameGetterCapability.ReturnType?.TypeId); 169Assert.Equal("Aspire.Hosting.CodeGeneration.TypeScript.Tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests.TestTypes.TestCallbackContext", nameSetterCapability.ReturnType?.TypeId); // Returns context for fluent chaining 177Assert.Equal("number", valueGetterCapability.ReturnType?.TypeId); 260t.TypeId == "Aspire.Hosting.CodeGeneration.TypeScript.Tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests.TestTypes.TestRedisResource"); 372c.ExpandedTargetTypes.Any(t => t.TypeId.Contains("ContainerResource"))) 377TargetType = c.TargetType != null ? new { c.TargetType.TypeId, c.TargetType.IsInterface } : null, 379.Where(t => t.TypeId.Contains("ContainerResource")) 380.Select(t => new { t.TypeId, t.IsInterface }) 420if (expandedType.TypeId.Contains("ContainerResource")) 423$"Capability '{cap.CapabilityId}' ExpandedTargetType '{expandedType.TypeId}' has IsInterface = true"); 446Assert.Equal("Aspire.Hosting/Aspire.Hosting.ApplicationModel.ContainerResource", withBindMount.TargetType.TypeId); 475Assert.Contains("IResourceWithConnectionString", withConnectionStringDirect.TargetType.TypeId); 483.FirstOrDefault(t => t.TypeId.Contains("TestRedisResource")); 503Assert.Contains("TestRedisResource", withRedisSpecific.TargetType.TypeId); 511.FirstOrDefault(t => t.TypeId.Contains("TestRedisResource")); 529Assert.Contains("ContainerResource", withBindMount.TargetType.TypeId); 537.FirstOrDefault(t => t.TypeId.Contains("ContainerResource") && !t.TypeId.Contains("IContainer")); 635$"Expanded type '{expandedType.TypeId}' should be a concrete type, not an interface"); 659Assert.Contains("IResourceWithEnvironment", testWithEnvironmentCallback.TargetType.TypeId); 668.FirstOrDefault(t => t.TypeId.Contains("TestRedisResource")); 739.Any(i => i.TypeId.Contains("IResourceWithEnvironment")); 889Assert.Equal("any", valueParam.Type.TypeId); 1013Assert.Equal(AtsConstants.CancellationToken, ctParam.Type.TypeId); 1046Assert.Equal(AtsConstants.CancellationToken, operationParam.CallbackParameters[0].Type?.TypeId); 1065Assert.Equal(AtsConstants.TimeSpan, timeoutParam.Type?.TypeId); 1069Assert.Equal(AtsConstants.CancellationToken, ctParam.Type?.TypeId);
Aspire.Hosting.RemoteHost (4)
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),