using HrynCo.NotificationService.DAL.EF.Entities; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; namespace HrynCo.NotificationService.DAL.EF.Configurations; internal sealed class ServiceEntityConfiguration : IEntityTypeConfiguration { public void Configure(EntityTypeBuilder builder) { builder.ToTable("services"); builder.HasKey(x => x.Id); builder.Property(x => x.Id).HasColumnName("id"); builder.Property(x => x.Name).HasColumnName("name").HasMaxLength(100).IsRequired(); builder.HasIndex(x => x.Name).IsUnique(); builder.Property(x => x.Revision).HasColumnName("revision").IsConcurrencyToken(); builder.Property(x => x.Created).HasColumnName("created"); builder.Property(x => x.Updated).HasColumnName("updated"); } }