| | | 1 | | using Microsoft.EntityFrameworkCore; |
| | | 2 | | using Microsoft.EntityFrameworkCore.Metadata.Builders; |
| | | 3 | | using ProjectTemplate.Infrastructure.Data.Entities; |
| | | 4 | | |
| | | 5 | | namespace ProjectTemplate.Infrastructure.Data.Configurations; |
| | | 6 | | |
| | | 7 | | /// <summary> |
| | | 8 | | /// Configures the EF Core mapping for <see cref="AuditRecord"/>. |
| | | 9 | | /// </summary> |
| | | 10 | | public sealed class AuditRecordConfiguration : IEntityTypeConfiguration<AuditRecord> |
| | | 11 | | { |
| | | 12 | | /// <inheritdoc /> |
| | | 13 | | public void Configure(EntityTypeBuilder<AuditRecord> builder) |
| | | 14 | | { |
| | 6 | 15 | | builder.ToTable("AuditRecords"); |
| | | 16 | | |
| | 6 | 17 | | builder.HasKey(x => x.Id); |
| | | 18 | | |
| | 6 | 19 | | builder.Property(x => x.Id) |
| | 6 | 20 | | .ValueGeneratedNever(); |
| | | 21 | | |
| | 6 | 22 | | builder.Property(x => x.ModifiedBy) |
| | 6 | 23 | | .HasMaxLength(200) |
| | 6 | 24 | | .IsRequired(); |
| | | 25 | | |
| | 6 | 26 | | builder.Property(x => x.ModifiedOnUtc) |
| | 6 | 27 | | .IsRequired(); |
| | | 28 | | |
| | 6 | 29 | | builder.Property(x => x.Application) |
| | 6 | 30 | | .HasMaxLength(200) |
| | 6 | 31 | | .IsRequired(); |
| | | 32 | | |
| | 6 | 33 | | builder.Property(x => x.Entity) |
| | 6 | 34 | | .HasMaxLength(200) |
| | 6 | 35 | | .IsRequired(); |
| | | 36 | | |
| | 6 | 37 | | builder.Property(x => x.State) |
| | 6 | 38 | | .HasMaxLength(100) |
| | 6 | 39 | | .IsRequired(); |
| | | 40 | | |
| | 6 | 41 | | builder.Property(x => x.KeyValues) |
| | 6 | 42 | | .IsRequired(); |
| | | 43 | | |
| | 6 | 44 | | builder.Property(x => x.OriginalValues) |
| | 6 | 45 | | .IsRequired(); |
| | | 46 | | |
| | 6 | 47 | | builder.Property(x => x.CurrentValues) |
| | 6 | 48 | | .IsRequired(); |
| | 6 | 49 | | } |
| | | 50 | | } |