21 lines
597 B
C#
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);
|
|
|
|
}
|
|
|
|
|
|
} |