Files
telegram-bot/Core/Data/CoreContext.cs
T

24 lines
591 B
C#
Raw Normal View History

2022-01-22 21:54:11 +03:00
using Kruzya.TelegramBot.Core.EF;
2020-03-08 01:55:50 +04:00
using Microsoft.EntityFrameworkCore;
2023-07-29 15:14:52 +03:00
namespace Kruzya.TelegramBot.Core.Data;
public class CoreContext : AutoSaveDbContext
2020-03-08 01:55:50 +04:00
{
2023-07-29 15:14:52 +03:00
/// <summary>
/// The all known users.
/// </summary>
public DbSet<BotUser> Users { get; set; }
2020-03-08 01:55:50 +04:00
2023-07-29 15:14:52 +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
2023-07-29 15:14:52 +03:00
public DbSet<ChatOptionValue> ChatOptionValues { get; set; }
2023-07-20 20:24:16 +03:00
2023-07-29 15:14:52 +03:00
public CoreContext(DbContextOptions<CoreContext> ctx) : base(ctx)
{
Database.Migrate();
2020-03-08 01:55:50 +04:00
}
}