update dependencies and add workflow for publish nuget
build nuget workflow for TelegramBotBase project / Build-TelegramBotBase (x64, linux) (push) Failing after 41s
build nuget workflow for TelegramBotBase project / Build-TelegramBotBase (x64, linux) (push) Failing after 41s
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using Newtonsoft.Json;
|
||||
using System.Text.Json;
|
||||
using TelegramBotBase.Args;
|
||||
using TelegramBotBase.Base;
|
||||
using TelegramBotBase.Form;
|
||||
@@ -48,11 +48,7 @@ public class JsonStateMachine : IStateMachine
|
||||
{
|
||||
var content = File.ReadAllText(FilePath);
|
||||
|
||||
var sc = JsonConvert.DeserializeObject<StateContainer>(content, new JsonSerializerSettings
|
||||
{
|
||||
TypeNameHandling = TypeNameHandling.All,
|
||||
TypeNameAssemblyFormatHandling = TypeNameAssemblyFormatHandling.Simple
|
||||
});
|
||||
var sc = JsonSerializer.Deserialize<StateContainer>(content);
|
||||
|
||||
return sc;
|
||||
}
|
||||
@@ -77,10 +73,9 @@ public class JsonStateMachine : IStateMachine
|
||||
|
||||
try
|
||||
{
|
||||
var content = JsonConvert.SerializeObject(e.States, Formatting.Indented, new JsonSerializerSettings
|
||||
var content = JsonSerializer.Serialize(e.States, new JsonSerializerOptions
|
||||
{
|
||||
TypeNameHandling = TypeNameHandling.All,
|
||||
TypeNameAssemblyFormatHandling = TypeNameAssemblyFormatHandling.Simple
|
||||
WriteIndented = true,
|
||||
});
|
||||
|
||||
File.WriteAllText(FilePath, content);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using Newtonsoft.Json;
|
||||
using System.Text.Json;
|
||||
using TelegramBotBase.Args;
|
||||
using TelegramBotBase.Base;
|
||||
using TelegramBotBase.Form;
|
||||
@@ -49,7 +49,7 @@ public class SimpleJsonStateMachine : IStateMachine
|
||||
{
|
||||
var content = File.ReadAllText(FilePath);
|
||||
|
||||
var sc = JsonConvert.DeserializeObject<StateContainer>(content);
|
||||
var sc = JsonSerializer.Deserialize<StateContainer>(content);
|
||||
|
||||
return sc;
|
||||
}
|
||||
@@ -74,7 +74,9 @@ public class SimpleJsonStateMachine : IStateMachine
|
||||
|
||||
try
|
||||
{
|
||||
var content = JsonConvert.SerializeObject(e.States, Formatting.Indented);
|
||||
var content = JsonSerializer.Serialize(e.States, new JsonSerializerOptions() {
|
||||
WriteIndented = true
|
||||
});
|
||||
|
||||
File.WriteAllText(FilePath, content);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user