| | 1 | | using Newtonsoft.Json; |
| | 2 | | using Plainquire.Filter.Newtonsoft.JsonConverters; |
| | 3 | | using System.Collections.Generic; |
| | 4 | |
|
| | 5 | | namespace Plainquire.Filter.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 filter expression related classes. |
| | 14 | | /// </summary> |
| 2 | 15 | | public static readonly JsonConverter[] NewtonsoftConverters = [new EntityFilterConverter()]; |
| | 16 | |
|
| | 17 | | /// <summary> |
| | 18 | | /// Adds support to serialize/deserialize filter expression related classes. |
| | 19 | | /// </summary> |
| | 20 | | /// <param name="converters">The converters.</param> |
| | 21 | | /// <autogeneratedoc /> |
| | 22 | | public static void AddFilterNewtonsoftSupport(this IList<JsonConverter> converters) |
| | 23 | | { |
| 24 | 24 | | foreach (var converter in NewtonsoftConverters) |
| 6 | 25 | | converters.Add(converter); |
| 6 | 26 | | } |
| | 27 | | } |