using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; using GreenTree.Strohrmann.ERP.Core.Domain.Rights; using System; using System.Collections.Generic; using System.Text; using GreenTree.Strohrmann.ERP.Core.Domain.Business; namespace GreenTree.Strohrmann.ERP.Domain.Model.Business { public class CraftEmployeeMapping : IEntityTypeConfiguration { public void Configure(EntityTypeBuilder builder) { builder.ToTable("CraftEmployees"); builder.HasKey(ce => new { ce.CraftId, ce.EmployeeId }); builder.HasOne(rp => rp.Craft) .WithMany(r => r.CraftEmployees); } } }