MessageWallMap.cs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using System.ComponentModel.DataAnnotations.Schema;
  2. using System.Data.Entity.ModelConfiguration;
  3. namespace YZXYH.Repository.Models.Mapping
  4. {
  5. public class MessageWallMap : EntityTypeConfiguration<MessageWallInfo>
  6. {
  7. public MessageWallMap()
  8. {
  9. // Primary Key
  10. this.HasKey(t => t.Id);
  11. // Properties
  12. this.Property(t => t.Id)
  13. .IsRequired();
  14. this.Property(t => t.NickName)
  15. .IsRequired()
  16. .HasMaxLength(50);
  17. this.Property(t => t.OpenId)
  18. .HasMaxLength(50);
  19. this.Property(t => t.MsgContent)
  20. .HasMaxLength(1000);
  21. this.Property(t => t.Mobile)
  22. .HasMaxLength(20);
  23. this.Property(t => t.Avatar)
  24. .HasMaxLength(500);
  25. this.Property(t => t.ImagePath)
  26. .HasMaxLength(500);
  27. this.Property(t => t.Path)
  28. .HasMaxLength(500);
  29. // Table & Column Mappings
  30. this.ToTable("MessageWallInfos");
  31. this.Property(t => t.Id).HasColumnName("Id");
  32. this.Property(t => t.NickName).HasColumnName("NickName");
  33. this.Property(t => t.MsgContent).HasColumnName("MsgContent");
  34. this.Property(t => t.Mobile).HasColumnName("Mobile");
  35. this.Property(t => t.MsgDateTime).HasColumnName("MsgDateTime");
  36. this.Property(t => t.IsHead).HasColumnName("IsHead");
  37. this.Property(t => t.Remark).HasColumnName("Remark");
  38. this.Property(t => t.Avatar).HasColumnName("Avatar");
  39. }
  40. }
  41. }