| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- using System.ComponentModel.DataAnnotations.Schema;
- using System.Data.Entity.ModelConfiguration;
- namespace YZXYH.Repository.Models.Mapping
- {
- public class QuestionnaireMap : EntityTypeConfiguration<Questionnaire>
- {
- public QuestionnaireMap()
- {
- // Primary Key
- this.HasKey(t => t.Id);
- // Properties
- this.Property(t => t.Id)
- .IsRequired()
- .HasMaxLength(32);
- this.Property(t => t.Title)
- .IsRequired()
- .HasMaxLength(150);
- this.Property(t => t.QuestionContent)
- .HasMaxLength(int.MaxValue);
- this.Property(t => t.Footer)
- .HasMaxLength(int.MaxValue);
- this.Property(t => t.CreateUserNo)
- .HasMaxLength(50);
- this.Property(t => t.ModifyUserNo)
- .HasMaxLength(50);
- this.Property(t => t.Remark)
- .HasMaxLength(500);
- this.Property(t => t.IsLocked)
- .IsRequired()
- .IsFixedLength()
- .HasMaxLength(1);
- // Table & Column Mappings
- this.ToTable("Questionnaires");
-
- }
- }
- }
|