diff --git a/.gitea/workflows/TelegramBotFramework.nuget.yaml b/.gitea/workflows/TelegramBotFramework.nuget.yaml index 1a3c622..bc00dd5 100644 --- a/.gitea/workflows/TelegramBotFramework.nuget.yaml +++ b/.gitea/workflows/TelegramBotFramework.nuget.yaml @@ -8,7 +8,7 @@ jobs: Build-TelegramBotBase: env: APP_PROJECT_NAME: TelegramBotBase - PACKAGE_VERSION: "123.0.1" + PACKAGE_VERSION: "123.1.0" strategy: matrix: os: diff --git a/TelegramBotBase/SessionManager.cs b/TelegramBotBase/SessionManager.cs index f5e04d1..0932275 100644 --- a/TelegramBotBase/SessionManager.cs +++ b/TelegramBotBase/SessionManager.cs @@ -302,17 +302,21 @@ public class SessionManager se.Values = ssea.Values; } - - //Search for public properties with SaveState attribute - var fields = form.GetType() - .GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) - .Where(a => a.GetCustomAttributes(typeof(SaveState), true).Length != 0).ToList(); - - foreach (var f in fields) + else { - var val = f.GetValue(form); - se.Values.Add("$" + f.Name, val); + + //Search for public properties with SaveState attribute + var fields = form.GetType() + .GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) + .Where(a => a.GetCustomAttributes(typeof(SaveState), true).Length != 0).ToList(); + + foreach (var f in fields) + { + var val = f.GetValue(form); + + se.Values.Add("$" + f.Name, val); + } } states.Add(se);