using LexWells.Infrastructure.EntityFramework; using Microsoft.EntityFrameworkCore; using NewsArchival.Core.Models; namespace NewsArchival.Api.Data; public class AppDbContext(DbContextOptions options) : LexWellsDbContext(options) { public DbSet
Articles => Set
(); protected override void OnModelCreating(ModelBuilder modelBuilder) { base.OnModelCreating(modelBuilder); // Ensure we don't save the same URL twice modelBuilder.Entity
() .HasIndex(a => a.Url) .IsUnique(); } }