using Microsoft.EntityFrameworkCore; using SequenceAuth.Example.Domain; namespace SequenceAuth.Example.Infrastructure; public class AppDbContext(DbContextOptions options) : DbContext(options) { public DbSet Users => Set(); public DbSet Todos => Set(); protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder.Entity(entity => { entity.HasKey(e => e.Id); entity.Property(e => e.Username).IsRequired(); entity.HasIndex(e => e.Username).IsUnique(); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.Id); entity.Property(e => e.Title).IsRequired(); entity.Property(e => e.Status).HasConversion(); }); } }