using System.ComponentModel.DataAnnotations.Schema; using System.Data.Entity.ModelConfiguration; namespace YZXYH.Repository.Models.Mapping { public class ViewUserCreateActivityMap : EntityTypeConfiguration { public ViewUserCreateActivityMap() { // Primary Key this.HasKey(t => new { t.Id, t.AcName, t.AcDate, t.AcType, t.Comments, t.ContactUser, t.Address, t.TimeEnd }); // Properties this.Property(t => t.Id) .IsRequired() .HasMaxLength(32); this.Property(t => t.AcName) .IsRequired() .HasMaxLength(100); this.Property(t => t.AcDate) .IsRequired() .HasMaxLength(50); this.Property(t => t.AcType) .IsRequired() .HasMaxLength(50); this.Property(t => t.Comments) .IsRequired(); this.Property(t => t.Stauts) .IsFixedLength() .HasMaxLength(1); this.Property(t => t.ContactUser) .IsRequired() .HasMaxLength(50); this.Property(t => t.Address) .IsRequired() .HasMaxLength(200); this.Property(t => t.MaxNum) .HasMaxLength(10); this.Property(t => t.IsLocked) .IsFixedLength() .HasMaxLength(1); this.Property(t => t.Cost) .HasMaxLength(10); this.Property(t => t.CreatedUserNo) .HasMaxLength(50); this.Property(t => t.HeadDisply) .IsFixedLength() .HasMaxLength(1); this.Property(t => t.SortNo) .HasMaxLength(4); this.Property(t => t.Name) .HasMaxLength(50); this.Property(t => t.HobbyGroupName) .HasMaxLength(50); this.Property(t => t.GraduationYear) .IsFixedLength() .HasMaxLength(4); // Table & Column Mappings this.ToTable("ViewUserCreateActivity"); this.Property(t => t.Id).HasColumnName("Id"); this.Property(t => t.AcName).HasColumnName("AcName"); this.Property(t => t.AcDate).HasColumnName("AcDate"); this.Property(t => t.AcType).HasColumnName("AcType"); this.Property(t => t.Comments).HasColumnName("Comments"); this.Property(t => t.Stauts).HasColumnName("Stauts"); this.Property(t => t.ContactUser).HasColumnName("ContactUser"); this.Property(t => t.Address).HasColumnName("Address"); this.Property(t => t.MaxNum).HasColumnName("MaxNum"); this.Property(t => t.IsLocked).HasColumnName("IsLocked"); this.Property(t => t.Cost).HasColumnName("Cost"); this.Property(t => t.TimeStart).HasColumnName("TimeStart"); this.Property(t => t.TimeEnd).HasColumnName("TimeEnd"); this.Property(t => t.TimeCreated).HasColumnName("TimeCreated"); this.Property(t => t.TimeModify).HasColumnName("TimeModify"); this.Property(t => t.CreatedUserNo).HasColumnName("CreatedUserNo"); this.Property(t => t.HeadDisply).HasColumnName("HeadDisply"); this.Property(t => t.SortNo).HasColumnName("SortNo"); this.Property(t => t.Name).HasColumnName("Name"); this.Property(t => t.HobbyGroupName).HasColumnName("HobbyGroupName"); this.Property(t => t.GraduationYear).HasColumnName("GraduationYear"); } } }