using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; namespace Novelly.Api.Genres; public class Genre { public Guid Id { get; init; } = Guid.NewGuid(); public string Name { get; init; } = string.Empty; } public class GenreEntityTypeConfiguration : IEntityTypeConfiguration { public void Configure(EntityTypeBuilder entity) { entity.Property(g => g.Name).IsRequired().HasMaxLength(100); entity.HasIndex(g => g.Name).IsUnique(); entity.HasData(SeededGenres.All); } }