mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2026-02-14 20:26:07 +08:00
采用全新的数据库架构
This commit is contained in:
44
OpenAuth.Repository/Models/Mapping/UserCfgMap.cs
Normal file
44
OpenAuth.Repository/Models/Mapping/UserCfgMap.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Data.Entity.ModelConfiguration;
|
||||
using OpenAuth.Domain;
|
||||
|
||||
namespace OpenAuth.Repository.Models.Mapping
|
||||
{
|
||||
public class UserCfgMap : EntityTypeConfiguration<UserCfg>
|
||||
{
|
||||
public UserCfgMap()
|
||||
{
|
||||
// Primary Key
|
||||
this.HasKey(t => t.Id);
|
||||
|
||||
// Properties
|
||||
this.Property(t => t.Id)
|
||||
.HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);
|
||||
|
||||
this.Property(t => t.Theme)
|
||||
.IsRequired()
|
||||
.HasMaxLength(255);
|
||||
|
||||
this.Property(t => t.Skin)
|
||||
.IsRequired()
|
||||
.HasMaxLength(255);
|
||||
|
||||
this.Property(t => t.NavBarStyle)
|
||||
.IsRequired()
|
||||
.HasMaxLength(255);
|
||||
|
||||
this.Property(t => t.TabFocusColor)
|
||||
.IsRequired()
|
||||
.HasMaxLength(255);
|
||||
|
||||
// Table & Column Mappings
|
||||
this.ToTable("UserCfg");
|
||||
this.Property(t => t.Id).HasColumnName("Id");
|
||||
this.Property(t => t.Theme).HasColumnName("Theme");
|
||||
this.Property(t => t.Skin).HasColumnName("Skin");
|
||||
this.Property(t => t.NavBarStyle).HasColumnName("NavBarStyle");
|
||||
this.Property(t => t.TabFocusColor).HasColumnName("TabFocusColor");
|
||||
this.Property(t => t.NavTabIndex).HasColumnName("NavTabIndex");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user