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