1 type derived from DerivedAIContent
Microsoft.Extensions.AI.Abstractions.Tests (1)
Utilities\AIJsonUtilitiesTests.cs (1)
1915
private class LeafContent :
DerivedAIContent
5 instantiations of DerivedAIContent
Microsoft.Extensions.AI.Abstractions.Tests (5)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JsonContext.DerivedAIContent.g.cs (1)
33
ObjectCreator = () => new global::Microsoft.Extensions.AI.AIJsonUtilitiesTests.
DerivedAIContent
(),
Utilities\AIJsonUtilitiesTests.cs (4)
1240
AIContent c = new
DerivedAIContent
{ DerivedValue = 42 };
1281
AIContent c = new
DerivedAIContent
();
1414
AIContent ac = new
DerivedAIContent
{ DerivedValue = 1 };
1466
AIContent unregistered = new
DerivedAIContent
{ DerivedValue = 99 };
41 references to DerivedAIContent
Microsoft.Extensions.AI.Abstractions.Tests (41)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JsonContext.DerivedAIContent.g.cs (14)
15
private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.AIJsonUtilitiesTests.
DerivedAIContent
>? _DerivedAIContent;
21
public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.AIJsonUtilitiesTests.
DerivedAIContent
> DerivedAIContent
24
get => _DerivedAIContent ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.AIJsonUtilitiesTests.
DerivedAIContent
>)Options.GetTypeInfo(typeof(global::Microsoft.Extensions.AI.AIJsonUtilitiesTests.
DerivedAIContent
));
27
private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.AIJsonUtilitiesTests.
DerivedAIContent
> Create_DerivedAIContent(global::System.Text.Json.JsonSerializerOptions options)
29
if (!TryGetTypeInfoForRuntimeCustomConverter<global::Microsoft.Extensions.AI.AIJsonUtilitiesTests.
DerivedAIContent
>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.AIJsonUtilitiesTests.
DerivedAIContent
> jsonTypeInfo))
31
var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Microsoft.Extensions.AI.AIJsonUtilitiesTests.
DerivedAIContent
>
37
ConstructorAttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.AIJsonUtilitiesTests.
DerivedAIContent
).GetConstructor(InstanceMemberBindingFlags, binder: null, global::System.Array.Empty<global::System.Type>(), modifiers: null),
41
jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Microsoft.Extensions.AI.AIJsonUtilitiesTests.
DerivedAIContent
>(options, objectInfo);
58
DeclaringType = typeof(global::Microsoft.Extensions.AI.AIJsonUtilitiesTests.
DerivedAIContent
),
60
Getter = static obj => ((global::Microsoft.Extensions.AI.AIJsonUtilitiesTests.
DerivedAIContent
)obj).DerivedValue,
61
Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.AIJsonUtilitiesTests.
DerivedAIContent
)obj).DerivedValue = value!,
68
AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.AIJsonUtilitiesTests.
DerivedAIContent
).GetProperty("DerivedValue", InstanceMemberBindingFlags, null, typeof(int), global::System.Array.Empty<global::System.Type>(), null),
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JsonContext.GetJsonTypeInfo.g.cs (1)
40
if (type == typeof(global::Microsoft.Extensions.AI.AIJsonUtilitiesTests.
DerivedAIContent
))
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JsonContext.LeafContent.g.cs (4)
78
DeclaringType = typeof(global::Microsoft.Extensions.AI.AIJsonUtilitiesTests.
DerivedAIContent
),
80
Getter = static obj => ((global::Microsoft.Extensions.AI.AIJsonUtilitiesTests.
DerivedAIContent
)obj).DerivedValue,
81
Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.AIJsonUtilitiesTests.
DerivedAIContent
)obj).DerivedValue = value!,
88
AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.AIJsonUtilitiesTests.
DerivedAIContent
).GetProperty("DerivedValue", InstanceMemberBindingFlags, null, typeof(int), global::System.Array.Empty<global::System.Type>(), null),
Utilities\AIJsonUtilitiesTests.cs (22)
1238
options.AddAIContentType<
DerivedAIContent
>("derivativeContent");
1245
Assert.IsType<
DerivedAIContent
>(deserialized);
1251
Assert.Throws<InvalidOperationException>(() => AIJsonUtilities.DefaultOptions.AddAIContentType<
DerivedAIContent
>("derivativeContent"));
1278
options.AddAIContentType<
DerivedAIContent
>("text");
1279
options.AddAIContentType<
DerivedAIContent
>("audio");
1289
Assert.Throws<ArgumentNullException>("options", () => ((JsonSerializerOptions)null!).AddAIContentType<
DerivedAIContent
>("discriminator"));
1290
Assert.Throws<ArgumentNullException>("options", () => ((JsonSerializerOptions)null!).AddAIContentType(typeof(
DerivedAIContent
), "discriminator"));
1291
Assert.Throws<ArgumentNullException>("typeDiscriminatorId", () => options.AddAIContentType<
DerivedAIContent
>(null!));
1292
Assert.Throws<ArgumentNullException>("typeDiscriminatorId", () => options.AddAIContentType(typeof(
DerivedAIContent
), null!));
1316
var derivedAIContentTypes = options.GetTypeInfo(typeof(
DerivedAIContent
)).PolymorphismOptions!.DerivedTypes;
1322
DerivedAIContent
dc = new LeafContent { DerivedValue = 1, LeafValue = 42 };
1328
LeafContent deserializedDc = Assert.IsType<LeafContent>(JsonSerializer.Deserialize<
DerivedAIContent
>(json, options));
1403
options.AddAIContentType<
DerivedAIContent
>("derived");
1408
var derivedAIContentTypes = options.GetTypeInfo(typeof(
DerivedAIContent
)).PolymorphismOptions!.DerivedTypes;
1409
Assert.Contains(aiContentDerivedTypes, dt => dt.DerivedType == typeof(
DerivedAIContent
));
1417
DerivedAIContent
deserializedDc = Assert.IsType<
DerivedAIContent
>(JsonSerializer.Deserialize<AIContent>(json, options));
1421
DerivedAIContent
dc = new LeafContent { DerivedValue = 2, LeafValue = 42 };
1424
LeafContent deserializedLeaf = Assert.IsType<LeafContent>(JsonSerializer.Deserialize<
DerivedAIContent
>(json2, options));
1454
var derivedAIContentTypes = options.GetTypeInfo(typeof(
DerivedAIContent
)).PolymorphismOptions!.DerivedTypes;
1456
Assert.DoesNotContain(aiContentDerivedTypes, dt => dt.DerivedType == typeof(
DerivedAIContent
));
1942
[JsonSerializable(typeof(
DerivedAIContent
))]