using System.ComponentModel.DataAnnotations.Schema; using System.Data.Entity.ModelConfiguration; namespace YZXYH.Repository.Models.Mapping { public class MessageWallMap : EntityTypeConfiguration { public MessageWallMap() { // Primary Key this.HasKey(t => t.Id); // Properties this.Property(t => t.Id) .IsRequired(); this.Property(t => t.NickName) .IsRequired() .HasMaxLength(50); this.Property(t => t.OpenId) .HasMaxLength(50); this.Property(t => t.MsgContent) .HasMaxLength(1000); this.Property(t => t.Mobile) .HasMaxLength(20); this.Property(t => t.Avatar) .HasMaxLength(500); this.Property(t => t.ImagePath) .HasMaxLength(500); this.Property(t => t.Path) .HasMaxLength(500); // Table & Column Mappings this.ToTable("MessageWallInfos"); this.Property(t => t.Id).HasColumnName("Id"); this.Property(t => t.NickName).HasColumnName("NickName"); this.Property(t => t.MsgContent).HasColumnName("MsgContent"); this.Property(t => t.Mobile).HasColumnName("Mobile"); this.Property(t => t.MsgDateTime).HasColumnName("MsgDateTime"); this.Property(t => t.IsHead).HasColumnName("IsHead"); this.Property(t => t.Remark).HasColumnName("Remark"); this.Property(t => t.Avatar).HasColumnName("Avatar"); } } }