mirror of
https://github.com/Bubuni-Team/telegram-bot.git
synced 2026-07-31 00:29:24 +03:00
Fix (?) issues related with concurrency
This commit is contained in:
@@ -1,28 +1,19 @@
|
||||
using System.Threading.Tasks;
|
||||
using Kruzya.TelegramBot.Core.EF;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Kruzya.TelegramBot.Core.Data
|
||||
{
|
||||
public class CoreContext : DbContext
|
||||
public class CoreContext : AutoSaveDbContext
|
||||
{
|
||||
/// <summary>
|
||||
/// The all known users.
|
||||
/// </summary>
|
||||
public DbSet<BotUser> Users { get; set; }
|
||||
|
||||
public DbSet<BotUserValue> UserValues { get; set; }
|
||||
|
||||
public override void Dispose()
|
||||
{
|
||||
SaveChanges();
|
||||
base.Dispose();
|
||||
}
|
||||
|
||||
public override ValueTask DisposeAsync()
|
||||
{
|
||||
SaveChanges();
|
||||
return base.DisposeAsync();
|
||||
}
|
||||
/// <summary>
|
||||
/// The all knows user options and values.
|
||||
/// </summary>
|
||||
public DbSet<BotUserValue> UserValues { get; set; }
|
||||
|
||||
public CoreContext(DbContextOptions<CoreContext> ctx) : base(ctx)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user