mirror of
https://github.com/Bubuni-Team/telegram-bot.git
synced 2026-07-31 00:29:24 +03:00
Initial KV API concept
This commit is contained in:
@@ -2,6 +2,7 @@ using System.Threading.Tasks;
|
||||
using Kruzya.TelegramBot.Core.Data;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Kruzya.TelegramBot.Core.Extensions
|
||||
{
|
||||
@@ -51,6 +52,9 @@ namespace Kruzya.TelegramBot.Core.Extensions
|
||||
public static async Task<BotUserValue> FindOrCreateOption(this DbSet<BotUserValue> repository, long chatId,
|
||||
long userId, string option)
|
||||
{
|
||||
repository.GetService<ILogger<Core>>().LogCritical("FindOrCreateOption() is deprecated. " +
|
||||
"Please, use the new API OptionManagerService.");
|
||||
|
||||
var opt = await repository.FindOption(chatId, userId, option);
|
||||
if (opt == null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user