mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-07-18 04:33:27 +08:00
34 lines
972 B
C#
34 lines
972 B
C#
![]() |
using System.Data.Entity.ModelConfiguration;
|
||
|
using OpenAuth.Domain;
|
||
|
|
||
|
namespace OpenAuth.Repository.Models.Mapping
|
||
|
{
|
||
|
public class MenuButtonMap : EntityTypeConfiguration<MenuButton>
|
||
|
{
|
||
|
public MenuButtonMap()
|
||
|
{
|
||
|
// Primary Key
|
||
|
this.HasKey(t => t.MenuButtonId);
|
||
|
|
||
|
// Properties
|
||
|
this.Property(t => t.MenuButtonId)
|
||
|
.IsRequired()
|
||
|
.HasMaxLength(50);
|
||
|
|
||
|
this.Property(t => t.MenuId)
|
||
|
.IsRequired()
|
||
|
.HasMaxLength(50);
|
||
|
|
||
|
this.Property(t => t.ButtonId)
|
||
|
.IsRequired()
|
||
|
.HasMaxLength(50);
|
||
|
|
||
|
// Table & Column Mappings
|
||
|
this.ToTable("MenuButton");
|
||
|
this.Property(t => t.MenuButtonId).HasColumnName("MenuButtonId");
|
||
|
this.Property(t => t.MenuId).HasColumnName("MenuId");
|
||
|
this.Property(t => t.ButtonId).HasColumnName("ButtonId");
|
||
|
}
|
||
|
}
|
||
|
}
|