using FindAndDrive.Domain.Models.Entities; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; namespace FindAndDrive.Persistence.EntityConfigurations { public class ApplicantCreditConfiguration : IEntityTypeConfiguration { public void Configure(EntityTypeBuilder builder) { builder.HasKey(k => k.ApplicantCreditId); //builder.HasOne(k => k.ApplicantCredit).Has //Not necassary to specify all collumns, collumns taken from models //Specify max length on string fields only //builder.Property(p => p.Title).HasMaxLength(5); builder.Property(p => p.RiskBankDescription).HasMaxLength(50); builder.Property(p => p.ReasonVerbiage).HasMaxLength(500); builder.Property(p => p.ReasonCode).HasMaxLength(50); } } }