Добавил DI, основные классы создаются через вбрасывание зависимостей через конструктор
This commit is contained in:
@@ -5,6 +5,7 @@ using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Threading;
|
||||
using Telegram.Bot;
|
||||
using ZaoBot.Config;
|
||||
|
||||
namespace ZaoBot
|
||||
{
|
||||
@@ -12,9 +13,9 @@ namespace ZaoBot
|
||||
{
|
||||
private JsonDocument config;
|
||||
|
||||
public NotificationReceiver(JsonDocument config)
|
||||
public NotificationReceiver(IConfig config)
|
||||
{
|
||||
this.config = config;
|
||||
this.config = config.Data;
|
||||
}
|
||||
|
||||
public void Run()
|
||||
|
||||
Reference in New Issue
Block a user