| 1234567891011121314151617181920212223242526272829303132 |
- 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 CraftMaterialMapping : IEntityTypeConfiguration<CraftMaterial>
- {
- public void Configure(EntityTypeBuilder<CraftMaterial> builder)
- {
- builder.ToTable("CraftMaterials");
- builder.HasKey(cm => new { cm.CraftId, cm.MaterialId });
- builder.Property(cm => cm.Amount)
- .IsRequired();
- builder.Property(cm => cm.CalculationFactor)
- .IsRequired();
- builder.Property(cm => cm.Value)
- .IsRequired();
- builder.HasOne(rp => rp.Craft)
- .WithMany(r => r.CraftMaterials);
- }
- }
- }
|