LotteryMap.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  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 LotteryMap : EntityTypeConfiguration<Lottery>
  11. {
  12. public LotteryMap()
  13. {
  14. // Primary Key
  15. this.HasKey(t => t.Id);
  16. this.Property(t => t.LotteryName)
  17. .IsRequired()
  18. .HasMaxLength(50);
  19. this.Property(t => t.LotteryGroup)
  20. .IsRequired()
  21. .HasMaxLength(50);
  22. this.Property(t => t.Mobile)
  23. .HasMaxLength(50);
  24. this.Property(t => t.ExpLotteryType)
  25. .HasMaxLength(100);
  26. this.ToTable("CJ_Lottery");
  27. this.Property(t => t.Id).HasColumnName("Id").HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
  28. this.Property(t => t.LotteryName).HasColumnName("LotteryName");
  29. this.Property(t => t.LotteryGroup).HasColumnName("LotteryGroup");
  30. this.Property(t => t.Mobile).HasColumnName("Mobile");
  31. this.Property(t => t.ExpLotteryType).HasColumnName("ExpLotteryType");
  32. }
  33. }
  34. }