From 7cfff20cad0bd9b047ed2277249a9b197b67a96d Mon Sep 17 00:00:00 2001 From: Bogdan Date: Tue, 20 Jun 2023 07:42:54 +0300 Subject: [PATCH] Create overload for `ToJson()` with Formatting param (cherry picked from commit aa2b0031671b6846eaa75e0914cd03ae7bbb0da7) --- src/NzbDrone.Common/Serializer/Newtonsoft.Json/Json.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/NzbDrone.Common/Serializer/Newtonsoft.Json/Json.cs b/src/NzbDrone.Common/Serializer/Newtonsoft.Json/Json.cs index fce2f295f..fef5b3c94 100644 --- a/src/NzbDrone.Common/Serializer/Newtonsoft.Json/Json.cs +++ b/src/NzbDrone.Common/Serializer/Newtonsoft.Json/Json.cs @@ -121,6 +121,11 @@ namespace NzbDrone.Common.Serializer return JsonConvert.SerializeObject(obj, SerializerSettings); } + public static string ToJson(this object obj, Formatting formatting) + { + return JsonConvert.SerializeObject(obj, formatting, SerializerSettings); + } + public static void Serialize(TModel model, TextWriter outputStream) { var jsonTextWriter = new JsonTextWriter(outputStream);