LotteryRecordMap.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel.DataAnnotations.Schema;
  4. using System.Data.Entity.ModelConfiguration;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. namespace YZXYH.Repository.Models.Mapping
  9. {
  10. public class LotteryRecordMap : EntityTypeConfiguration<LotteryRecord>
  11. {
  12. public LotteryRecordMap()
  13. {
  14. // Primary Key
  15. this.HasKey(t => t.Id);
  16. this.Property(t => t.LotteryId)
  17. .IsRequired();
  18. this.Property(t => t.LotteryName)
  19. .IsRequired()
  20. .HasMaxLength(50);
  21. this.Property(t => t.LotteryGroup)
  22. .IsRequired()
  23. .HasMaxLength(50);
  24. this.Property(t => t.LotteryType)
  25. .IsRequired()
  26. .HasMaxLength(50);
  27. this.Property(t => t.Mobile)
  28. .HasMaxLength(50);
  29. this.ToTable("CJ_LotteryRecord");
  30. this.Property(t => t.Id).HasColumnName("Id").HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
  31. this.Property(t => t.LotteryId).HasColumnName("LotteryId");
  32. this.Property(t => t.LotteryName).HasColumnName("LotteryName");
  33. this.Property(t => t.LotteryGroup).HasColumnName("LotteryGroup");
  34. this.Property(t => t.LotteryType).HasColumnName("LotteryType");
  35. this.Property(t => t.Mobile).HasColumnName("Mobile");
  36. }
  37. }
  38. }