You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
1.3 KiB

using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Microsoft.EntityFrameworkCore;
using Shentun.Peis.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Shentun.Peis.EntityFrameworkCore;
namespace Shentun.Peis.DbMapping
{
internal class ColumnReferenceInterfaceDbMapping : IEntityTypeConfiguration<ColumnReferenceInterface>
{
public void Configure(EntityTypeBuilder<ColumnReferenceInterface> entity)
{
entity.HasComment("字段对照第三方系统编码表");
entity.Property(t => t.InterfaceCodeValue).HasComment("第三方系统编码值").IsRequired();
entity.Property(t => t.ColumnReferenceCodeId).HasComment("字段对照本系统编码表ID").IsRequired();
entity.Property(e => e.Id)
.IsFixedLength()
.HasComment("编号").HasColumnName("id");
entity.HasOne(d => d.ColumnReferenceCode)
.WithMany(p => p.ColumnReferenceInterfaces)
.HasForeignKey(d => d.ColumnReferenceCodeId)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("fk_columnreferenceinterface_columnreferencecode");
entity.ConfigureByConvention();
}
}
}