From a03bb5e7aa098dafe772ce11a6f5d189a6125004 Mon Sep 17 00:00:00 2001 From: Oleg Shabunov Date: Fri, 21 Jun 2024 20:54:47 +0400 Subject: [PATCH] pretty JSON formatting --- AutoWorkshopBusinessLogic/BusinessLogics/BackUpLogic.cs | 6 ++++-- AutoWorkshopRestApi/appsettings.json | 2 +- AutoWorkshopView/App.config | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/AutoWorkshopBusinessLogic/BusinessLogics/BackUpLogic.cs b/AutoWorkshopBusinessLogic/BusinessLogics/BackUpLogic.cs index 07b88be..be5ab27 100644 --- a/AutoWorkshopBusinessLogic/BusinessLogics/BackUpLogic.cs +++ b/AutoWorkshopBusinessLogic/BusinessLogics/BackUpLogic.cs @@ -92,9 +92,11 @@ namespace AutoWorkshopBusinessLogic.BusinessLogics } var JsonFormatter = new DataContractJsonSerializer(typeof(List)); - using var fs = new FileStream(string.Format("{0}/{1}.json", FolderName, typeof(T).Name), FileMode.OpenOrCreate); - JsonFormatter.WriteObject(fs, Records); + using var fs = new FileStream(string.Format("{0}/{1}.json", FolderName, typeof(T).Name), FileMode.OpenOrCreate); + using var writer = JsonReaderWriterFactory.CreateJsonWriter(fs, System.Text.Encoding.UTF8, false, true); + + JsonFormatter.WriteObject(writer, Records); } } } diff --git a/AutoWorkshopRestApi/appsettings.json b/AutoWorkshopRestApi/appsettings.json index e2ba257..d8573d6 100644 --- a/AutoWorkshopRestApi/appsettings.json +++ b/AutoWorkshopRestApi/appsettings.json @@ -12,5 +12,5 @@ "PopHost": "pop.gmail.com", "PopPort": "995", "MailLogin": "testingpurposeslab7@gmail.com", - "MailPassword": "gvdg ovtu lmis djwq" + "MailPassword": "kxdk seny yjaj vrav" } diff --git a/AutoWorkshopView/App.config b/AutoWorkshopView/App.config index 12ffdeb..a45c9ab 100644 --- a/AutoWorkshopView/App.config +++ b/AutoWorkshopView/App.config @@ -6,6 +6,6 @@ - + \ No newline at end of file