using Kruzya.TelegramBot.Core.EF; using Microsoft.EntityFrameworkCore; namespace West.TelegramBot.Reputation.Data; public class ReputationContext : AutoSaveDbContext { public DbSet UserReputation { get; set; } = null!; public ReputationContext(DbContextOptions options) : base(options) { Database.EnsureCreated(); } protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder.Entity().HasKey(e => new {e.ChatId, e.UserId}); modelBuilder.Entity().HasIndex(e => e.ChatId); } }