| | | 1 | | using System.Diagnostics.CodeAnalysis; |
| | | 2 | | using System.Reflection; |
| | | 3 | | using System.Text.Json; |
| | | 4 | | using System.Text.Json.Serialization; |
| | | 5 | | using Elsa.Workflows.Attributes; |
| | | 6 | | using Elsa.Workflows.Serialization.Helpers; |
| | | 7 | | |
| | | 8 | | namespace Elsa.Workflows.Serialization.Converters; |
| | | 9 | | |
| | | 10 | | /// <summary> |
| | | 11 | | /// Ignores properties with the <see cref="JsonIgnoreCompositeRootAttribute"/> attribute. |
| | | 12 | | /// </summary> |
| | 1272 | 13 | | public class JsonIgnoreCompositeRootConverter(ActivityWriter activityWriter) : JsonConverter<IActivity> |
| | | 14 | | { |
| | | 15 | | /// <inheritdoc /> |
| | | 16 | | public override IActivity Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) |
| | | 17 | | { |
| | 0 | 18 | | throw new NotImplementedException(); |
| | | 19 | | } |
| | | 20 | | |
| | | 21 | | /// <inheritdoc /> |
| | | 22 | | [UnconditionalSuppressMessage("Trimming", "IL2026:Members annotated with 'RequiresUnreferencedCodeAttribute' require |
| | | 23 | | public override void Write(Utf8JsonWriter writer, IActivity? value, JsonSerializerOptions options) |
| | | 24 | | { |
| | 12932 | 25 | | activityWriter.WriteActivity(writer, value, options, ignoreSpecializedConverters: true, propertyFilter: property |
| | 1184 | 26 | | } |
| | | 27 | | } |