33 instantiations of AtsTypeRef
Aspire.Hosting.RemoteHost (31)
AtsCapabilityScanner.cs (31)
762
var targetTypeRef = capability.TargetType ?? new
AtsTypeRef
792
var concreteTypeRef = new
AtsTypeRef
1100
: new
AtsTypeRef
{ TypeId = AtsConstants.Any, Category = AtsTypeCategory.Primitive };
1102
propertyTypeRef = new
AtsTypeRef
1127
propertyTypeRef = new
AtsTypeRef
{ TypeId = AtsConstants.Any, Category = AtsTypeCategory.Primitive };
1144
var contextTypeRef = new
AtsTypeRef
1250
var instanceContextTypeRef = new
AtsTypeRef
1569
? new
AtsTypeRef
{ TypeId = "callback", Category = AtsTypeCategory.Callback }
1623
returnTypeRef = new
AtsTypeRef
{ TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive };
1627
returnTypeRef = 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 }
1669
var voidTypeRef = new
AtsTypeRef
{ TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive };
1986
private static AtsTypeRef CreateVoidTypeRef() => new
AtsTypeRef
2056
return new
AtsTypeRef
{ TypeId = primitiveTypeId, ClrType = type, Category = AtsTypeCategory.Primitive };
2062
return new
AtsTypeRef
{ TypeId = AtsConstants.Any, ClrType = type, Category = AtsTypeCategory.Primitive };
2071
return new
AtsTypeRef
2094
return new
AtsTypeRef
2117
return new
AtsTypeRef
2139
return new
AtsTypeRef
2159
return new
AtsTypeRef
2187
return new
AtsTypeRef
2198
return new
AtsTypeRef
2218
return new
AtsTypeRef
2234
return new
AtsTypeRef
2246
return new
AtsTypeRef
2256
return new
AtsTypeRef
2336
allInterfaces.Add(new
AtsTypeRef
2371
baseTypes.Add(new
AtsTypeRef
2631
return new
AtsTypeRef
Aspire.Hosting.RemoteHost.Tests (2)
AtsMarshallerTests.cs (2)
190
var typeRef = new
AtsTypeRef
730
var typeRef = new
AtsTypeRef
{ TypeId = "test/SelfReferencingDto", Category = AtsTypeCategory.Dto };
137 references to AtsTypeRef
Aspire.Hosting.CodeGeneration.Go (8)
AtsGoCodeGenerator.cs (8)
227
var
returnType = method.ReturnType!;
396
private static bool IsListOrDictPropertyGetter(
AtsTypeRef
? returnType)
408
var
returnType = capability.ReturnType!;
558
foreach (
var
expandedType in capability.ExpandedTargetTypes)
604
foreach (
var
targetType in targetTypes)
648
private string MapTypeRefToGo(
AtsTypeRef
? typeRef, bool isOptional)
726
private static void AddHandleTypeIfNeeded(HashSet<string> handleTypeIds,
AtsTypeRef
? typeRef)
746
private static void AddListOrDictTypeIfNeeded(Dictionary<string, bool> typeIds,
AtsTypeRef
? typeRef)
Aspire.Hosting.CodeGeneration.Java (7)
AtsJavaCodeGenerator.cs (7)
348
private static bool IsListOrDictPropertyGetter(
AtsTypeRef
? returnType)
360
var
returnType = capability.ReturnType!;
528
foreach (
var
expandedType in capability.ExpandedTargetTypes)
574
foreach (
var
targetType in targetTypes)
617
private string MapTypeRefToJava(
AtsTypeRef
? typeRef, bool isOptional)
682
private static void AddHandleTypeIfNeeded(HashSet<string> handleTypeIds,
AtsTypeRef
? typeRef)
702
private static void AddListOrDictTypeIfNeeded(Dictionary<string, bool> typeIds,
AtsTypeRef
? typeRef)
Aspire.Hosting.CodeGeneration.Python (9)
AtsPythonCodeGenerator.cs (9)
301
private static bool IsListOrDictPropertyGetter(
AtsTypeRef
? returnType)
313
var
returnType = capability.ReturnType!;
435
foreach (
var
expandedType in capability.ExpandedTargetTypes)
479
foreach (
var
targetType in targetTypes)
568
private string MapTypeRefToPython(
AtsTypeRef
? typeRef)
600
private string MapUnionType(
AtsTypeRef
typeRef)
637
AtsTypeRef
? returnType)
652
private static void AddHandleTypeIfNeeded(HashSet<string> handleTypeIds,
AtsTypeRef
? typeRef)
665
private static void AddListOrDictTypeIfNeeded(Dictionary<string, bool> typeIds,
AtsTypeRef
? typeRef)
Aspire.Hosting.CodeGeneration.Rust (13)
AtsRustCodeGenerator.cs (13)
449
var
returnTypeRef = capability.ReturnType;
496
private static bool IsListOrDictPropertyGetter(
AtsTypeRef
? returnType)
510
var
returnType = capability.ReturnType!;
636
foreach (
var
expandedType in capability.ExpandedTargetTypes)
682
foreach (
var
targetType in targetTypes)
724
private string MapTypeRefToRust(
AtsTypeRef
? typeRef, bool isOptional)
762
private string MapTypeRefToRustForDto(
AtsTypeRef
? typeRef, bool isOptional)
818
private string MapParameterTypeToRust(
AtsTypeRef
? typeRef, bool isOptional)
850
private static bool IsHandleType(
AtsTypeRef
? typeRef) =>
855
private static bool IsCollectionOfHandleTypes(
AtsTypeRef
? typeRef) =>
861
private static bool IsAspireListOrDictParam(
AtsTypeRef
? typeRef) =>
873
private static void AddHandleTypeIfNeeded(HashSet<string> handleTypeIds,
AtsTypeRef
? typeRef)
893
private static void AddListOrDictTypeIfNeeded(HashSet<string> typeIds,
AtsTypeRef
? typeRef)
Aspire.Hosting.CodeGeneration.TypeScript (22)
AtsTypeScriptCodeGenerator.cs (22)
20
public
AtsTypeRef
? TargetType { get; init; }
128
private static bool IsHandleType(
AtsTypeRef
? typeRef) =>
135
private string MapTypeRefToTypeScript(
AtsTypeRef
? typeRef)
208
private string MapUnionTypeToTypeScript(
AtsTypeRef
typeRef)
250
private string MapInputTypeToTypeScript(
AtsTypeRef
? typeRef)
282
private static bool IsInterfaceHandleType(
AtsTypeRef
? typeRef)
291
private static bool IsCancellationTokenType(
AtsTypeRef
? typeRef) => typeRef?.TypeId == AtsConstants.CancellationToken;
293
private static string GetRpcArgumentValueExpression(string parameterName,
AtsTypeRef
? typeRef)
298
private static string GetRpcArgumentEntry(string parameterName,
AtsTypeRef
? typeRef)
1394
private string GenerateCallbackTypeSignature(IReadOnlyList<AtsCallbackParameterInfo>? callbackParameters,
AtsTypeRef
? callbackReturnType)
1938
private static bool IsDictionaryType(
AtsTypeRef
? typeRef)
1946
private static bool IsListType(
AtsTypeRef
? typeRef)
2527
var typeRefsByTypeId = new Dictionary<string,
AtsTypeRef
>();
2534
var
targetTypeRef = cap.TargetType;
2560
foreach (
var
expandedType in expandedTypes)
2606
var
typeRef = typeRefsByTypeId.GetValueOrDefault(typeId);
2639
var
typeRef = typeRefsByTypeId.GetValueOrDefault(interfaceTypeId);
2713
private static Dictionary<string,
AtsTypeRef
> CollectAllReferencedTypes(IReadOnlyList<AtsCapabilityInfo> capabilities)
2715
var typeRefs = new Dictionary<string,
AtsTypeRef
>();
2717
void CollectFromTypeRef(
AtsTypeRef
? typeRef)
2735
foreach (
var
unionType in typeRef.UnionTypes)
2845
private string? GetPromiseWrapperForReturnType(
AtsTypeRef
? returnType)
Aspire.Hosting.CodeGeneration.TypeScript.Tests (7)
AtsTypeScriptCodeGeneratorTests.cs (7)
252
var
testRedisTarget = withOptionalString.ExpandedTargetTypes.FirstOrDefault(t =>
436
foreach (
var
expandedType in cap.ExpandedTargetTypes)
500
var
testRedisExpanded = withConnectionStringDirect.ExpandedTargetTypes
528
var
testRedisExpanded = withRedisSpecific.ExpandedTargetTypes
554
var
containerExpanded = withBindMount.ExpandedTargetTypes
650
foreach (
var
expandedType in withConnectionStringDirect.ExpandedTargetTypes)
685
var
testRedisExpanded = testWithEnvironmentCallback.ExpandedTargetTypes
Aspire.Hosting.RemoteHost (54)
Ats\AtsMarshaller.cs (2)
131
public JsonNode? MarshalToJson(object? value,
AtsTypeRef
typeRef)
193
private JsonNode? SerializeArray(object value,
AtsTypeRef
? elementType)
AtsCapabilityScanner.cs (51)
541
private static void CollectEnumClrTypes(
AtsTypeRef
? typeRef, Dictionary<string, Type> enumTypes)
595
private static void ResolveTypeRef(
AtsTypeRef
? typeRef, HashSet<string> validTypes)
616
foreach (
var
memberType in typeRef.UnionTypes)
691
private static string? FindUnknownType(
AtsTypeRef
? typeRef)
716
foreach (
var
memberType in typeRef.UnionTypes)
762
var
targetTypeRef = capability.TargetType ?? new AtsTypeRef
779
private static Dictionary<string, List<
AtsTypeRef
>> BuildTypeCompatibilityMap(
782
var typeToCompatibleTypes = new Dictionary<string, List<
AtsTypeRef
>>();
792
var
concreteTypeRef = new AtsTypeRef
805
foreach (
var
iface in typeInfo.ImplementedInterfaces)
811
foreach (
var
baseType in typeInfo.BaseTypeHierarchy)
824
Dictionary<string, List<
AtsTypeRef
>> map,
826
AtsTypeRef
concreteTypeRef)
971
var
propTypeRef = CreateTypeRef(prop.PropertyType, enumCollector: null, assemblyExportedTypeCache);
1080
AtsTypeRef
? propertyTypeRef;
1095
var
keyTypeRef = CreateTypeRef(propType.GetGenericArguments().First(), enumCollector: null, assemblyExportedTypeCache);
1098
var
valueTypeRef = propertyUnionAttr != null
1144
var
contextTypeRef = new AtsTypeRef
1250
var
instanceContextTypeRef = new AtsTypeRef
1365
var
returnTypeRef = CreateTypeRef(method.ReturnType, enumCollector: null, assemblyExportedTypeCache);
1440
AtsTypeRef
? extendsTypeRef = null;
1493
var
returnTypeRef = CreateTypeRef(method.ReturnType, enumCollector: null, assemblyExportedTypeCache);
1529
var
unionTypeRef = CreateUnionTypeRef(unionAttr, $"parameter '{paramName}'", assemblyExportedTypeCache);
1545
var
typeRef = CreateTypeRef(paramType, enumCollector: null, assemblyExportedTypeCache);
1557
AtsTypeRef
? callbackReturnType = null;
1568
var
finalTypeRef = isCallback
1588
private static (IReadOnlyList<AtsCallbackParameterInfo>? Parameters,
AtsTypeRef
? ReturnType) ExtractCallbackSignature(
1606
var
paramTypeRef = CreateTypeRef(paramType, enumCollector: null, assemblyExportedTypeCache);
1619
AtsTypeRef
? returnTypeRef;
1652
private static (IReadOnlyList<AtsCallbackParameterInfo>? Parameters,
AtsTypeRef
? ReturnType) ExtractWellKnownDelegateSignature(
1669
var
voidTypeRef = new AtsTypeRef { TypeId = AtsConstants.Void, Category = AtsTypeCategory.Primitive };
1678
var
paramTypeRef = CreateTypeRef(paramType, enumCollector: null, assemblyExportedTypeCache);
1699
var
paramTypeRef = CreateTypeRef(paramType, enumCollector: null, assemblyExportedTypeCache);
1711
AtsTypeRef
returnTypeRef;
1980
public static
AtsTypeRef
? CreateTypeRef(Type? type) =>
1986
private static
AtsTypeRef
CreateVoidTypeRef() => new AtsTypeRef
1995
private static
AtsTypeRef
? CreateTypeRef(
2090
var
keyTypeRef = CreateTypeRef(genericArgs[0], enumCollector, assemblyExportedTypeCache);
2091
var
valueTypeRef = CreateTypeRef(genericArgs[1], enumCollector, assemblyExportedTypeCache);
2113
var
keyTypeRef = CreateTypeRef(genericArgs[0], enumCollector, assemblyExportedTypeCache);
2114
var
valueTypeRef = CreateTypeRef(genericArgs[1], enumCollector, assemblyExportedTypeCache);
2136
var
elementTypeRef = CreateTypeRef(genericArgs[0], enumCollector, assemblyExportedTypeCache);
2156
var
elementTypeRef = CreateTypeRef(genericArgs[0], enumCollector, assemblyExportedTypeCache);
2215
var
elementTypeRef = CreateTypeRef(elementType, enumCollector, assemblyExportedTypeCache);
2328
private static List<
AtsTypeRef
> CollectAllInterfaces(Type type)
2330
var allInterfaces = new List<
AtsTypeRef
>();
2352
private static List<
AtsTypeRef
> CollectBaseTypeHierarchy(Type type)
2354
var baseTypes = new List<
AtsTypeRef
>();
2605
private static
AtsTypeRef
CreateUnionTypeRef(
2617
var unionTypes = new List<
AtsTypeRef
>();
2620
var
typeRef = CreateTypeRef(memberType, enumCollector: null, assemblyExportedTypeCache);
CodeGeneration\CodeGenerationService.cs (1)
95
private static TypeRefResponse MapTypeRef(
AtsTypeRef
t) => new()
Aspire.Hosting.RemoteHost.Tests (4)
AtsCapabilityScannerTests.cs (2)
140
var
itemsType = Assert.IsType<
AtsTypeRef
>(itemsParameter.Type);
AtsMarshallerTests.cs (2)
190
var
typeRef = new AtsTypeRef
730
var
typeRef = new AtsTypeRef { TypeId = "test/SelfReferencingDto", Category = AtsTypeCategory.Dto };
Aspire.TypeSystem (13)
AtsCapabilityInfo.cs (13)
37
public
AtsTypeRef
? ElementType { get; init; }
42
public
AtsTypeRef
? KeyType { get; init; }
47
public
AtsTypeRef
? ValueType { get; init; }
75
public IReadOnlyList<
AtsTypeRef
>? UnionTypes { get; init; }
199
public required
AtsTypeRef
ReturnType { get; init; }
210
public
AtsTypeRef
? TargetType { get; init; }
226
public IReadOnlyList<
AtsTypeRef
> ExpandedTargetTypes { get; set; } = [];
265
public
AtsTypeRef
? Type { get; init; }
293
public
AtsTypeRef
? CallbackReturnType { get; init; }
314
public required
AtsTypeRef
Type { get; init; }
341
public IReadOnlyList<
AtsTypeRef
> ImplementedInterfaces { get; init; } = [];
348
public IReadOnlyList<
AtsTypeRef
> BaseTypeHierarchy { get; init; } = [];
413
public required
AtsTypeRef
Type { get; init; }