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

2 years ago
  1. using Microsoft.EntityFrameworkCore.Metadata.Builders;
  2. using Microsoft.EntityFrameworkCore;
  3. using Shentun.Peis.Models;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using Shentun.Peis.EntityFrameworkCore;
  10. namespace Shentun.Peis.DbMapping
  11. {
  12. internal class ColumnReferenceInterfaceDbMapping : IEntityTypeConfiguration<ColumnReferenceInterface>
  13. {
  14. public void Configure(EntityTypeBuilder<ColumnReferenceInterface> entity)
  15. {
  16. entity.HasComment("字段对照第三方系统编码表");
  17. entity.Property(t => t.InterfaceCodeValue).HasComment("第三方系统编码值").IsRequired();
  18. entity.Property(t => t.ColumnReferenceCodeId).HasComment("字段对照本系统编码表ID").IsRequired();
  19. entity.Property(e => e.Id)
  20. .IsFixedLength()
  21. .HasComment("编号").HasColumnName("id");
  22. entity.HasOne(d => d.ColumnReferenceCode)
  23. .WithMany(p => p.ColumnReferenceInterfaces)
  24. .HasForeignKey(d => d.ColumnReferenceCodeId)
  25. .OnDelete(DeleteBehavior.ClientSetNull)
  26. .HasConstraintName("fk_columnreferenceinterface_columnreferencecode");
  27. entity.ConfigureByConvention();
  28. }
  29. }
  30. }