| 123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- using System.ComponentModel.DataAnnotations.Schema;
- using System.Data.Entity.ModelConfiguration;
- namespace YZXYH.Repository.Models.Mapping
- {
- public class UserReplyMap : EntityTypeConfiguration<UserReply>
- {
- public UserReplyMap()
- {
- // Primary Key
- this.HasKey(t => t.Id);
- // Properties
- this.Property(t => t.Id)
- .IsRequired()
- .HasMaxLength(50);
- this.Property(t => t.TypeReplyId)
- .IsRequired()
- .IsFixedLength()
- .HasMaxLength(10);
- this.Property(t => t.ParentId)
- .IsRequired()
- .HasMaxLength(50);
- this.Property(t => t.ContentReply)
- .IsRequired();
- this.Property(t => t.IsLocked)
- .IsRequired()
- .IsFixedLength()
- .HasMaxLength(1);
- // Table & Column Mappings
- this.ToTable("UserReply");
- this.Property(t => t.Id).HasColumnName("Id");
- this.Property(t => t.TypeReplyId).HasColumnName("TypeReplyId");
- this.Property(t => t.ParentId).HasColumnName("ParentId");
- this.Property(t => t.ContentReply).HasColumnName("ContentReply");
- this.Property(t => t.TimeReply).HasColumnName("TimeReply");
- this.Property(t => t.IsLocked).HasColumnName("IsLocked");
- }
- }
- }
|