Files
Backend-Api/CompanyManagment.EFCore/Mapping/PaymentInstrumentGroupMapping.cs
2025-07-30 17:03:01 +03:30

19 lines
673 B
C#

using Company.Domain.PaymentInstrumentAgg;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using OfficeOpenXml.Drawing.Chart;
namespace CompanyManagment.EFCore.Mapping;
public class PaymentInstrumentGroupMapping:IEntityTypeConfiguration<PaymentInstrumentGroup>
{
public void Configure(EntityTypeBuilder<PaymentInstrumentGroup> builder)
{
builder.HasKey(x => x.id);
builder.Property(x => x.Name).IsRequired().HasMaxLength(120);
builder.HasMany(x => x.PaymentInstruments)
.WithOne(x=>x.PaymentInstrumentGroup)
.HasForeignKey(x=>x.PaymentInstrumentGroupId);
}
}