using Govor.Core.Models; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; namespace Govor.Data.Configurations; public class MediaFileConfiguration : IEntityTypeConfiguration { public void Configure(EntityTypeBuilder builder) { builder.HasKey(ma => ma.Id); builder.Property(mf => mf.Url) .IsRequired(); builder.Property(mf => mf.MediaType) .HasConversion() // enum as string (e.g., "Image") .IsRequired(); builder.Property(ma => ma.MineType) .HasMaxLength(128) .IsRequired(); builder.Property(mf => mf.DateCreated) .IsRequired(); } }