19 lines
494 B
C#
19 lines
494 B
C#
namespace JOBot.Backend.DAL.Context;
|
|
|
|
using JOBot.Backend.DAL.Models;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
public class AppDbContext : DbContext
|
|
{
|
|
public DbSet<User> Users { get; set; }
|
|
|
|
public AppDbContext(DbContextOptions<AppDbContext> options) : base(options) { }
|
|
|
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
|
{
|
|
base.OnModelCreating(modelBuilder);
|
|
|
|
modelBuilder.Entity<User>()
|
|
.HasAlternateKey(b => b.TelegramId);
|
|
}
|
|
} |