| | 1 | | using Newtonsoft.Json; |
| | 2 | | using Plainquire.Page.Newtonsoft.JsonConverters; |
| | 3 | | using System.Collections.Generic; |
| | 4 | |
|
| | 5 | | namespace Plainquire.Page.Newtonsoft; |
| | 6 | |
|
| | 7 | | /// <summary> |
| | 8 | | /// Extension methods for <see cref="JsonConverter"/>. |
| | 9 | | /// </summary> |
| | 10 | | public static class JsonConverterExtensions |
| | 11 | | { |
| | 12 | | /// <summary> |
| | 13 | | /// List of Newtonsoft JSON converters required to serialize/deserialize page related classes. |
| | 14 | | /// </summary> |
| 2 | 15 | | public static readonly JsonConverter[] NewtonsoftConverters = [ |
| 2 | 16 | | new EntityPageConverter() |
| 2 | 17 | | ]; |
| | 18 | |
|
| | 19 | | /// <summary> |
| | 20 | | /// Adds support to serialize/deserialize page related classes. |
| | 21 | | /// </summary> |
| | 22 | | /// <param name="converters">The converters.</param> |
| | 23 | | /// <autogeneratedoc /> |
| | 24 | | public static void AddPageNewtonsoftSupport(this IList<JsonConverter> converters) |
| | 25 | | { |
| 24 | 26 | | foreach (var converter in NewtonsoftConverters) |
| 6 | 27 | | converters.Add(converter); |
| 6 | 28 | | } |
| | 29 | | } |