using FindAndDrive.Domain.Models.Entities; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; namespace FindAndDrive.Persistence.EntityConfigurations; public class ApiKeyConfiguration : IEntityTypeConfiguration { public void Configure(EntityTypeBuilder builder) { builder.ToTable("ApiKeys").HasKey(k => k.ApiKeyId); builder.HasOne(w => w.Client) .WithMany(w => w.ApiKeys) .HasForeignKey(w => w.ClientId); builder.HasOne(w => w.Role) .WithMany(w => w.ApiKeys) .HasForeignKey(w => w.RoleId) .OnDelete(DeleteBehavior.NoAction); } }