Files
Backend-Api/CompanyManagment.EFCore/Mapping/InsuranceMapping.cs
2024-07-05 21:36:15 +03:30

21 lines
597 B
C#

using Company.Domain.InsuranceAgg;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace CompanyManagment.EFCore.Mapping;
public class InsuranceMapping : IEntityTypeConfiguration<Insurance>
{
public void Configure(EntityTypeBuilder<Insurance> builder)
{
builder.ToTable("Insurances");
builder.HasKey(x => x.id);
builder.Property(x => x.Month).HasMaxLength(2).IsRequired();
builder.Property(x => x.Year).HasMaxLength(4).IsRequired();
builder.Property(x => x.Address).HasMaxLength(255);
}
}