2015-04-15 23:57:36 +08:00
|
|
|
using System.Data.Entity.ModelConfiguration;
|
2015-04-25 12:31:01 +08:00
|
|
|
using OpenAuth.Domain.Model;
|
2015-04-15 23:57:36 +08:00
|
|
|
|
2015-05-23 12:10:53 +08:00
|
|
|
namespace OpenAuth.Repository.Mapping
|
2015-04-15 23:57:36 +08:00
|
|
|
{
|
|
|
|
|
public class ButtonMap : EntityTypeConfiguration<Button>
|
|
|
|
|
{
|
|
|
|
|
public ButtonMap()
|
|
|
|
|
{
|
|
|
|
|
// Primary Key
|
2015-05-23 12:10:53 +08:00
|
|
|
this.HasKey(t => t.Id);
|
2015-04-15 23:57:36 +08:00
|
|
|
|
|
|
|
|
// Properties
|
2015-05-23 12:10:53 +08:00
|
|
|
this.Property(t => t.Id)
|
2015-04-15 23:57:36 +08:00
|
|
|
.IsRequired()
|
|
|
|
|
.HasMaxLength(50);
|
|
|
|
|
|
|
|
|
|
this.Property(t => t.FullName)
|
|
|
|
|
.HasMaxLength(50);
|
|
|
|
|
|
|
|
|
|
this.Property(t => t.Img)
|
|
|
|
|
.HasMaxLength(50);
|
|
|
|
|
|
|
|
|
|
this.Property(t => t.Event)
|
|
|
|
|
.HasMaxLength(200);
|
|
|
|
|
|
|
|
|
|
this.Property(t => t.Control_ID)
|
|
|
|
|
.HasMaxLength(50);
|
|
|
|
|
|
|
|
|
|
this.Property(t => t.Category)
|
|
|
|
|
.HasMaxLength(50);
|
|
|
|
|
|
|
|
|
|
this.Property(t => t.Description)
|
|
|
|
|
.HasMaxLength(200);
|
|
|
|
|
|
|
|
|
|
// Table & Column Mappings
|
|
|
|
|
this.ToTable("Button");
|
2015-05-23 12:10:53 +08:00
|
|
|
this.Property(t => t.Id).HasColumnName("ButtonId");
|
2015-04-15 23:57:36 +08:00
|
|
|
this.Property(t => t.FullName).HasColumnName("FullName");
|
|
|
|
|
this.Property(t => t.Img).HasColumnName("Img");
|
|
|
|
|
this.Property(t => t.Event).HasColumnName("Event");
|
|
|
|
|
this.Property(t => t.Control_ID).HasColumnName("Control_ID");
|
|
|
|
|
this.Property(t => t.Category).HasColumnName("Category");
|
|
|
|
|
this.Property(t => t.Description).HasColumnName("Description");
|
|
|
|
|
this.Property(t => t.Enabled).HasColumnName("Enabled");
|
|
|
|
|
this.Property(t => t.SortCode).HasColumnName("SortCode");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|