using System.ComponentModel.DataAnnotations.Schema; using System.Data.Entity.ModelConfiguration; namespace YZXYH.Repository.Models.Mapping { public class View_UserLastLoginTimeMap : EntityTypeConfiguration { public View_UserLastLoginTimeMap() { // Primary Key this.HasKey(t => new { t.UserNo, t.Name, t.Mobile }); // Properties this.Property(t => t.UserNo) .IsRequired() .HasMaxLength(50); this.Property(t => t.Name) .IsRequired() .HasMaxLength(50); this.Property(t => t.Mobile) .IsRequired() .HasMaxLength(15); // Table & Column Mappings this.ToTable("View_UserLastLoginTime"); this.Property(t => t.UserNo).HasColumnName("UserNo"); this.Property(t => t.TimeLastLogin).HasColumnName("TimeLastLogin"); this.Property(t => t.Name).HasColumnName("Name"); this.Property(t => t.Mobile).HasColumnName("Mobile"); } } }