UserLastLoginMap.cs 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. using System.ComponentModel.DataAnnotations.Schema;
  2. using System.Data.Entity.ModelConfiguration;
  3. namespace YZXYH.Repository.Models.Mapping
  4. {
  5. public class UserLastLoginMap : EntityTypeConfiguration<UserLastLogin>
  6. {
  7. public UserLastLoginMap()
  8. {
  9. // Primary Key
  10. this.HasKey(t => t.Id);
  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. .HasMaxLength(500);
  20. // Table & Column Mappings
  21. this.ToTable("UserLastLogin");
  22. this.Property(t => t.Id).HasColumnName("Id");
  23. this.Property(t => t.UserNo).HasColumnName("UserNo");
  24. this.Property(t => t.TimeLastLogin).HasColumnName("TimeLastLogin");
  25. this.Property(t => t.IpAddress).HasColumnName("IpAddress");
  26. }
  27. }
  28. }