using System.ComponentModel.DataAnnotations.Schema; using System.Data.Entity.ModelConfiguration; namespace YZXYH.Repository.Models.Mapping { public class UserAvatarMap : EntityTypeConfiguration { public UserAvatarMap() { // Primary Key this.HasKey(t => t.Id); // Properties this.Property(t => t.Id) .IsRequired() .HasMaxLength(50); this.Property(t => t.UserNo) .IsRequired() .HasMaxLength(50); this.Property(t => t.FileName) .HasMaxLength(50); this.Property(t => t.FilePath) .IsRequired() .HasMaxLength(500); this.Property(t => t.FileType) .HasMaxLength(20); this.Property(t => t.FileNo) .HasMaxLength(30); this.Property(t => t.IsLocked) .IsRequired() .IsFixedLength() .HasMaxLength(1); // Table & Column Mappings this.ToTable("UserAvatars"); this.Property(t => t.Id).HasColumnName("Id"); this.Property(t => t.UserNo).HasColumnName("UserNo"); this.Property(t => t.FileName).HasColumnName("FileName"); this.Property(t => t.FilePath).HasColumnName("FilePath"); this.Property(t => t.FileType).HasColumnName("FileType"); this.Property(t => t.FileNo).HasColumnName("FileNo"); this.Property(t => t.IsLocked).HasColumnName("IsLocked"); this.Property(t => t.TimeCreate).HasColumnName("TimeCreate"); this.Property(t => t.Remark).HasColumnName("Remark"); } } }