ViewUserLastLoginMap.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. using System.ComponentModel.DataAnnotations.Schema;
  2. using System.Data.Entity.ModelConfiguration;
  3. namespace YZXYH.Repository.Models.Mapping
  4. {
  5. public class ViewUserLastLoginMap : EntityTypeConfiguration<ViewUserLastLogin>
  6. {
  7. public ViewUserLastLoginMap()
  8. {
  9. // Primary Key
  10. this.HasKey(t => new { t.Id, t.UserNo });
  11. // Properties
  12. this.Property(t => t.Id)
  13. .IsRequired()
  14. .HasMaxLength(50);
  15. this.Property(t => t.UserNo)
  16. .IsRequired()
  17. .HasMaxLength(50);
  18. this.Property(t => t.IpAddress)
  19. .IsFixedLength()
  20. .HasMaxLength(10);
  21. // Table & Column Mappings
  22. this.ToTable("ViewUserLastLogin");
  23. this.Property(t => t.Id).HasColumnName("Id");
  24. this.Property(t => t.UserNo).HasColumnName("UserNo");
  25. this.Property(t => t.TimeLastLogin).HasColumnName("TimeLastLogin");
  26. this.Property(t => t.IpAddress).HasColumnName("IpAddress");
  27. }
  28. }
  29. }