2022-01-22 21:54:11 +03:00
|
|
|
using Kruzya.TelegramBot.Core.EF;
|
2020-03-08 01:55:50 +04:00
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
|
|
|
|
|
namespace Kruzya.TelegramBot.Core.Data
|
|
|
|
|
{
|
2022-01-22 21:54:11 +03:00
|
|
|
public class CoreContext : AutoSaveDbContext
|
2020-03-08 01:55:50 +04:00
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The all known users.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public DbSet<BotUser> Users { get; set; }
|
|
|
|
|
|
2022-01-22 21:54:11 +03:00
|
|
|
/// <summary>
|
|
|
|
|
/// The all knows user options and values.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public DbSet<BotUserValue> UserValues { get; set; }
|
2020-03-09 19:31:16 +04:00
|
|
|
|
2020-03-08 01:55:50 +04:00
|
|
|
public CoreContext(DbContextOptions<CoreContext> ctx) : base(ctx)
|
|
|
|
|
{
|
|
|
|
|
Database.Migrate();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|