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