using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; using MyNewProjectName.Domain.Entities; namespace MyNewProjectName.Infrastructure.Persistence.Configurations; /// /// Entity configuration for SampleEntity /// public class SampleEntityConfiguration : IEntityTypeConfiguration { public void Configure(EntityTypeBuilder builder) { builder.ToTable("Samples"); builder.HasKey(e => e.Id); builder.Property(e => e.Name) .IsRequired() .HasMaxLength(200); builder.Property(e => e.Description) .HasMaxLength(1000); builder.Property(e => e.CreatedBy) .HasMaxLength(100); builder.Property(e => e.UpdatedBy) .HasMaxLength(100); // Index for common queries builder.HasIndex(e => e.Name); builder.HasIndex(e => e.IsActive); } }