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.

38 lines
1.2 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 ColumnReferenceDbMapping : IEntityTypeConfiguration<ColumnReference>
{
public void Configure(EntityTypeBuilder<ColumnReference> entity)
{
entity.HasComment("字段对照主表");
entity.Property(t => t.DisplayName).HasComment("名称").IsRequired();
entity.Property(t => t.ColumnReferencePlugInsId).HasComment("插件ID").IsRequired();
entity.Property(e => e.Id)
.IsFixedLength()
.HasComment("编号").HasColumnName("id");
entity.HasOne(d => d.ColumnReferencePlugIns)
.WithMany(p => p.ColumnReferences)
.HasForeignKey(d => d.ColumnReferencePlugInsId)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("fk_columnreference_columnreferenceplugins");
entity.ConfigureByConvention();
}
}
}