using LendWise.Web.Models; using Microsoft.EntityFrameworkCore; namespace LendWise.Web.Data; public class AppDbContext(DbContextOptions options) : DbContext(options) { public DbSet LoanLeads => Set(); public DbSet ContactMessages => Set(); protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder.Entity(e => { e.Property(x => x.FullName).HasMaxLength(100); e.Property(x => x.Mobile).HasMaxLength(10); e.Property(x => x.Email).HasMaxLength(150); e.Property(x => x.City).HasMaxLength(80); e.Property(x => x.ApplicantType).HasMaxLength(30); e.Property(x => x.ProductSlug).HasMaxLength(60); e.Property(x => x.Status).HasMaxLength(30); e.Property(x => x.IpAddress).HasMaxLength(64); e.Property(x => x.Amount).HasPrecision(18, 2); e.Property(x => x.MonthlyIncome).HasPrecision(18, 2); e.HasIndex(x => x.CreatedUtc); }); modelBuilder.Entity(e => { e.Property(x => x.Name).HasMaxLength(100); e.Property(x => x.Email).HasMaxLength(150); e.Property(x => x.Phone).HasMaxLength(10); e.Property(x => x.Topic).HasMaxLength(40); e.Property(x => x.Message).HasMaxLength(2000); e.HasIndex(x => x.CreatedUtc); }); } }