22 lines
703 B
C#
22 lines
703 B
C#
using Company.Domain.DateSalaryItemAgg;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|
|
|
namespace CompanyManagment.EFCore.Mapping;
|
|
|
|
public class DateSalaryItemMapping : IEntityTypeConfiguration<DateSalaryItem>
|
|
{
|
|
public void Configure(EntityTypeBuilder<DateSalaryItem> builder)
|
|
{
|
|
builder.ToTable("DateSalaryItems");
|
|
builder.HasKey(x => x.id);
|
|
|
|
builder.HasOne(x => x.DateSalary)
|
|
.WithMany(x => x.DateSalaryItemList)
|
|
.HasForeignKey(x => x.DateSalaryId);
|
|
|
|
builder.HasOne(x => x.Percentage)
|
|
.WithMany(x => x.DateSalaryItemList)
|
|
.HasForeignKey(x => x.PercentageId);
|
|
}
|
|
} |