From aed3f9f887be3c1fcad77d7833fea6102fa016bd Mon Sep 17 00:00:00 2001 From: Bogdan Date: Tue, 20 Jun 2023 04:23:47 +0300 Subject: [PATCH] Create overload for ToJson for Formatting --- 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);