26 lines
681 B
C#
26 lines
681 B
C#
using Company.Domain.CrossJobItemsAgg;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|
|
|
namespace CompanyManagment.EFCore.Mapping;
|
|
|
|
public class CrossJobItemsMapping : IEntityTypeConfiguration<CrossJobItems>
|
|
{
|
|
public void Configure(EntityTypeBuilder<CrossJobItems> builder)
|
|
{
|
|
builder.ToTable("CrossJobItems");
|
|
builder.HasKey(x => x.id);
|
|
|
|
builder.HasOne(x => x.CrossJob)
|
|
.WithMany(x => x.CrossJobItemsList)
|
|
.HasForeignKey(x => x.CrossJobId);
|
|
|
|
builder.HasOne(x => x.Job)
|
|
.WithMany(x => x.CrossJobItemsList)
|
|
.HasForeignKey(x => x.JobId);
|
|
|
|
|
|
}
|
|
|
|
|
|
} |