using AutobusApi.Domain.Entities; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; namespace AutobusApi.Infrastructure.Data.Configurations; public class CountryConfiguration : EntityBaseConfiguration { public override void Configure(EntityTypeBuilder builder) { base.Configure(builder); builder .ToTable("countries") .HasKey(e => e.Id); builder .Property(c => c.Name) .HasColumnName("name") .HasColumnType("varchar(64)") .IsRequired(); builder .HasMany(c => c.Regions) .WithOne(r => r.Country) .OnDelete(DeleteBehavior.Cascade); } }