调整T4模板,领域模型增加注释

This commit is contained in:
yubaolee 2015-10-27 00:27:05 +08:00
parent 885d444761
commit 4e7f9ad0b3
25 changed files with 1478 additions and 327 deletions

View File

@ -52,10 +52,6 @@
<Project>{6108da8e-92a1-4abe-b9f5-26d64d55ca2c}</Project> <Project>{6108da8e-92a1-4abe-b9f5-26d64d55ca2c}</Project>
<Name>OpenAuth.Domain</Name> <Name>OpenAuth.Domain</Name>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\OpenAuth.Repository\OpenAuth.Repository.csproj">
<Project>{e8df8dea-e2cf-4bdb-8f4f-3f8205b0e03a}</Project>
<Name>OpenAuth.Repository</Name>
</ProjectReference>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.

View File

@ -1,22 +1,142 @@
using System;
using System.Collections.Generic;
using System;
namespace OpenAuth.Domain using System.Collections.Generic;
{ using System.Data;
public partial class Module using System.Linq;
{
public int Id { get; set; } namespace OpenAuth.Domain
public string CascadeId { get; set; } {
public string Name { get; set; } /// <summary>
public string Url { get; set; } /// 用户ID
public string HotKey { get; set; } /// </summary>
public int ParentId { get; set; } public partial class Module
public bool IsLeaf { get; set; } {
public bool IsAutoExpand { get; set; }
public string IconName { get; set; } /// <summary>
public int Status { get; set; } /// 用户ID
public string ParentName { get; set; } /// </summary>
public string Vector { get; set; } /// <returns></returns>
public int SortNo { get; set; } public int Id { get; set; }
}
}
/// <summary>
/// 节点语义ID
/// </summary>
/// <returns></returns>
public string CascadeId { get; set; }
/// <summary>
/// 组织名称
/// </summary>
/// <returns></returns>
public string Name { get; set; }
/// <summary>
/// 主页面URL
/// </summary>
/// <returns></returns>
public string Url { get; set; }
/// <summary>
/// 热键
/// </summary>
/// <returns></returns>
public string HotKey { get; set; }
/// <summary>
/// 父节点流水号
/// </summary>
/// <returns></returns>
public int ParentId { get; set; }
/// <summary>
/// 是否叶子节点
/// </summary>
/// <returns></returns>
public bool IsLeaf { get; set; }
/// <summary>
/// 是否自动展开
/// </summary>
/// <returns></returns>
public bool IsAutoExpand { get; set; }
/// <summary>
/// 节点图标文件名称
/// </summary>
/// <returns></returns>
public string IconName { get; set; }
/// <summary>
/// 当前状态
/// </summary>
/// <returns></returns>
public int Status { get; set; }
/// <summary>
/// 父节点名称
/// </summary>
/// <returns></returns>
public string ParentName { get; set; }
/// <summary>
/// 矢量图标
/// </summary>
/// <returns></returns>
public string Vector { get; set; }
/// <summary>
/// 排序号
/// </summary>
/// <returns></returns>
public int SortNo { get; set; }
public Module()
{
this.Id= 0;
this.CascadeId= string.Empty;
this.Name= string.Empty;
this.Url= string.Empty;
this.HotKey= string.Empty;
this.ParentId= 0;
this.IsLeaf= false;
this.IsAutoExpand= false;
this.IconName= string.Empty;
this.Status= 0;
this.ParentName= string.Empty;
this.Vector= string.Empty;
this.SortNo= 0;
}
}
}

View File

@ -1,15 +1,79 @@
using System;
using System.Collections.Generic;
using System;
namespace OpenAuth.Domain using System.Collections.Generic;
{ using System.Data;
public partial class ModuleRole using System.Linq;
{
public int Id { get; set; } namespace OpenAuth.Domain
public int RoleId { get; set; } {
public int ModuleId { get; set; } /// <summary>
public int Type { get; set; } /// 用户ID
public System.DateTime OperateTime { get; set; } /// </summary>
public int OperatorId { get; set; } public partial class ModuleRole
} {
}
/// <summary>
/// 用户ID
/// </summary>
/// <returns></returns>
public int Id { get; set; }
/// <summary>
/// 角色流水号
/// </summary>
/// <returns></returns>
public int RoleId { get; set; }
/// <summary>
/// 所属功能模块流水号
/// </summary>
/// <returns></returns>
public int ModuleId { get; set; }
/// <summary>
/// 组织类型
/// </summary>
/// <returns></returns>
public int Type { get; set; }
/// <summary>
/// 授权时间
/// </summary>
/// <returns></returns>
public System.DateTime OperateTime { get; set; }
/// <summary>
/// 授权人流水号
/// </summary>
/// <returns></returns>
public int OperatorId { get; set; }
public ModuleRole()
{
this.Id= 0;
this.RoleId= 0;
this.ModuleId= 0;
this.Type= 0;
this.OperateTime= DateTime.Now;
this.OperatorId= 0;
}
}
}

View File

@ -1,33 +1,169 @@
using System;
using System.Collections.Generic;
using System;
namespace OpenAuth.Domain using System.Collections.Generic;
{ using System.Data;
public partial class Org using System.Linq;
{
public int Id { get; set; } namespace OpenAuth.Domain
public string CascadeId { get; set; } {
public string Name { get; set; } /// <summary>
public string HotKey { get; set; } /// 用户ID
public int ParentId { get; set; } /// </summary>
public string ParentName { get; set; } public partial class Org
public bool IsLeaf { get; set; } {
public bool IsAutoExpand { get; set; }
public string IconName { get; set; } /// <summary>
public int Status { get; set; } /// 用户ID
public int Type { get; set; } /// </summary>
public string BizCode { get; set; } /// <returns></returns>
public string CustomCode { get; set; } public int Id { get; set; }
public System.DateTime CreateTime { get; set; }
public int CreateId { get; set; }
public int SortNo { get; set; } /// <summary>
/// 节点语义ID
public Org() /// </summary>
{ /// <returns></returns>
HotKey = ""; public string CascadeId { get; set; }
IconName = "";
BizCode = "";
CustomCode = ""; /// <summary>
} /// 组织名称
} /// </summary>
} /// <returns></returns>
public string Name { get; set; }
/// <summary>
/// 热键
/// </summary>
/// <returns></returns>
public string HotKey { get; set; }
/// <summary>
/// 父节点流水号
/// </summary>
/// <returns></returns>
public int ParentId { get; set; }
/// <summary>
/// 父节点名称
/// </summary>
/// <returns></returns>
public string ParentName { get; set; }
/// <summary>
/// 是否叶子节点
/// </summary>
/// <returns></returns>
public bool IsLeaf { get; set; }
/// <summary>
/// 是否自动展开
/// </summary>
/// <returns></returns>
public bool IsAutoExpand { get; set; }
/// <summary>
/// 节点图标文件名称
/// </summary>
/// <returns></returns>
public string IconName { get; set; }
/// <summary>
/// 当前状态
/// </summary>
/// <returns></returns>
public int Status { get; set; }
/// <summary>
/// 组织类型
/// </summary>
/// <returns></returns>
public int Type { get; set; }
/// <summary>
/// 业务对照码
/// </summary>
/// <returns></returns>
public string BizCode { get; set; }
/// <summary>
/// 自定义扩展码
/// </summary>
/// <returns></returns>
public string CustomCode { get; set; }
/// <summary>
/// 创建时间
/// </summary>
/// <returns></returns>
public System.DateTime CreateTime { get; set; }
/// <summary>
/// 创建人ID
/// </summary>
/// <returns></returns>
public int CreateId { get; set; }
/// <summary>
/// 排序号
/// </summary>
/// <returns></returns>
public int SortNo { get; set; }
public Org()
{
this.Id= 0;
this.CascadeId= string.Empty;
this.Name= string.Empty;
this.HotKey= string.Empty;
this.ParentId= 0;
this.ParentName= string.Empty;
this.IsLeaf= false;
this.IsAutoExpand= false;
this.IconName= string.Empty;
this.Status= 0;
this.Type= 0;
this.BizCode= string.Empty;
this.CustomCode= string.Empty;
this.CreateTime= DateTime.Now;
this.CreateId= 0;
this.SortNo= 0;
}
}
}

View File

@ -1,20 +1,124 @@
using System;
using System.Collections.Generic;
using System;
namespace OpenAuth.Domain using System.Collections.Generic;
{ using System.Data;
public partial class Page using System.Linq;
{
public int Id { get; set; } namespace OpenAuth.Domain
public int ModuleId { get; set; } {
public string Name { get; set; } /// <summary>
public string Url { get; set; } /// 用户ID
public int Type { get; set; } /// </summary>
public bool Enabled { get; set; } public partial class Page
public bool IsDefault { get; set; } {
public string Icon { get; set; }
public string IconBig { get; set; } /// <summary>
public string Vector { get; set; } /// 用户ID
public int SortNo { get; set; } /// </summary>
} /// <returns></returns>
} public int Id { get; set; }
/// <summary>
/// 所属功能模块流水号
/// </summary>
/// <returns></returns>
public int ModuleId { get; set; }
/// <summary>
/// 组织名称
/// </summary>
/// <returns></returns>
public string Name { get; set; }
/// <summary>
/// 主页面URL
/// </summary>
/// <returns></returns>
public string Url { get; set; }
/// <summary>
/// 组织类型
/// </summary>
/// <returns></returns>
public int Type { get; set; }
/// <summary>
/// 使能状态
/// </summary>
/// <returns></returns>
public bool Enabled { get; set; }
/// <summary>
/// 是否缺省子页面
/// </summary>
/// <returns></returns>
public bool IsDefault { get; set; }
/// <summary>
/// 小图标
/// </summary>
/// <returns></returns>
public string Icon { get; set; }
/// <summary>
/// 大图标
/// </summary>
/// <returns></returns>
public string IconBig { get; set; }
/// <summary>
/// 矢量图标
/// </summary>
/// <returns></returns>
public string Vector { get; set; }
/// <summary>
/// 排序号
/// </summary>
/// <returns></returns>
public int SortNo { get; set; }
public Page()
{
this.Id= 0;
this.ModuleId= 0;
this.Name= string.Empty;
this.Url= string.Empty;
this.Type= 0;
this.Enabled= false;
this.IsDefault= false;
this.Icon= string.Empty;
this.IconBig= string.Empty;
this.Vector= string.Empty;
this.SortNo= 0;
}
}
}

View File

@ -1,15 +1,79 @@
using System;
using System.Collections.Generic;
using System;
namespace OpenAuth.Domain using System.Collections.Generic;
{ using System.Data;
public partial class PageElement using System.Linq;
{
public int Id { get; set; } namespace OpenAuth.Domain
public string DomId { get; set; } {
public string Name { get; set; } /// <summary>
public int Type { get; set; } /// 用户ID
public int ModuleId { get; set; } /// </summary>
public string Remark { get; set; } public partial class PageElement
} {
}
/// <summary>
/// 用户ID
/// </summary>
/// <returns></returns>
public int Id { get; set; }
/// <summary>
/// DOM ID
/// </summary>
/// <returns></returns>
public string DomId { get; set; }
/// <summary>
/// 组织名称
/// </summary>
/// <returns></returns>
public string Name { get; set; }
/// <summary>
/// 组织类型
/// </summary>
/// <returns></returns>
public int Type { get; set; }
/// <summary>
/// 所属功能模块流水号
/// </summary>
/// <returns></returns>
public int ModuleId { get; set; }
/// <summary>
/// 备注
/// </summary>
/// <returns></returns>
public string Remark { get; set; }
public PageElement()
{
this.Id= 0;
this.DomId= string.Empty;
this.Name= string.Empty;
this.Type= 0;
this.ModuleId= 0;
this.Remark= string.Empty;
}
}
}

View File

@ -1,15 +1,79 @@
using System;
using System.Collections.Generic;
using System;
namespace OpenAuth.Domain using System.Collections.Generic;
{ using System.Data;
public partial class PageElementGrant using System.Linq;
{
public int Id { get; set; } namespace OpenAuth.Domain
public int ElementId { get; set; } {
public int UserId { get; set; } /// <summary>
public int RoleId { get; set; } /// 用户ID
public int PostId { get; set; } /// </summary>
public int GrantType { get; set; } public partial class PageElementGrant
} {
}
/// <summary>
/// 用户ID
/// </summary>
/// <returns></returns>
public int Id { get; set; }
/// <summary>
/// 页面元素流水号
/// </summary>
/// <returns></returns>
public int ElementId { get; set; }
/// <summary>
/// 用户流水号
/// </summary>
/// <returns></returns>
public int UserId { get; set; }
/// <summary>
/// 角色流水号
/// </summary>
/// <returns></returns>
public int RoleId { get; set; }
/// <summary>
/// 岗位流水号
/// </summary>
/// <returns></returns>
public int PostId { get; set; }
/// <summary>
/// 权限类型
/// </summary>
/// <returns></returns>
public int GrantType { get; set; }
public PageElementGrant()
{
this.Id= 0;
this.ElementId= 0;
this.UserId= 0;
this.RoleId= 0;
this.PostId= 0;
this.GrantType= 0;
}
}
}

View File

@ -1,17 +1,97 @@
using System;
using System.Collections.Generic;
using System;
namespace OpenAuth.Domain using System.Collections.Generic;
{ using System.Data;
public partial class Role using System.Linq;
{
public int Id { get; set; } namespace OpenAuth.Domain
public string Name { get; set; } {
public int Status { get; set; } /// <summary>
public int Type { get; set; } /// 用户ID
public System.DateTime CreateTime { get; set; } /// </summary>
public string CreateId { get; set; } public partial class Role
public int CreateOrgId { get; set; } {
public string CreateOrgCascadeId { get; set; }
} /// <summary>
} /// 用户ID
/// </summary>
/// <returns></returns>
public int Id { get; set; }
/// <summary>
/// 组织名称
/// </summary>
/// <returns></returns>
public string Name { get; set; }
/// <summary>
/// 当前状态
/// </summary>
/// <returns></returns>
public int Status { get; set; }
/// <summary>
/// 组织类型
/// </summary>
/// <returns></returns>
public int Type { get; set; }
/// <summary>
/// 创建时间
/// </summary>
/// <returns></returns>
public System.DateTime CreateTime { get; set; }
/// <summary>
/// 创建人ID
/// </summary>
/// <returns></returns>
public string CreateId { get; set; }
/// <summary>
/// 创建人所属部门流水号
/// </summary>
/// <returns></returns>
public int CreateOrgId { get; set; }
/// <summary>
/// 创建人所属部门节点语义ID
/// </summary>
/// <returns></returns>
public string CreateOrgCascadeId { get; set; }
public Role()
{
this.Id= 0;
this.Name= string.Empty;
this.Status= 0;
this.Type= 0;
this.CreateTime= DateTime.Now;
this.CreateId= string.Empty;
this.CreateOrgId= 0;
this.CreateOrgCascadeId= string.Empty;
}
}
}

View File

@ -1,19 +1,115 @@
using System;
using System.Collections.Generic;
using System;
namespace OpenAuth.Domain using System.Collections.Generic;
{ using System.Data;
public partial class User using System.Linq;
{
public int Id { get; set; } namespace OpenAuth.Domain
public string Account { get; set; } {
public string Password { get; set; } /// <summary>
public string Name { get; set; } /// 用户ID
public int Sex { get; set; } /// </summary>
public int Status { get; set; } public partial class User
public int Type { get; set; } {
public string BizCode { get; set; }
public System.DateTime CreateTime { get; set; } /// <summary>
public int CreateId { get; set; } /// 用户ID
} /// </summary>
} /// <returns></returns>
public int Id { get; set; }
/// <summary>
///
/// </summary>
/// <returns></returns>
public string Account { get; set; }
/// <summary>
///
/// </summary>
/// <returns></returns>
public string Password { get; set; }
/// <summary>
/// 组织名称
/// </summary>
/// <returns></returns>
public string Name { get; set; }
/// <summary>
///
/// </summary>
/// <returns></returns>
public int Sex { get; set; }
/// <summary>
/// 当前状态
/// </summary>
/// <returns></returns>
public int Status { get; set; }
/// <summary>
/// 组织类型
/// </summary>
/// <returns></returns>
public int Type { get; set; }
/// <summary>
/// 业务对照码
/// </summary>
/// <returns></returns>
public string BizCode { get; set; }
/// <summary>
/// 创建时间
/// </summary>
/// <returns></returns>
public System.DateTime CreateTime { get; set; }
/// <summary>
/// 创建人ID
/// </summary>
/// <returns></returns>
public int CreateId { get; set; }
public User()
{
this.Id= 0;
this.Account= string.Empty;
this.Password= string.Empty;
this.Name= string.Empty;
this.Sex= 0;
this.Status= 0;
this.Type= 0;
this.BizCode= string.Empty;
this.CreateTime= DateTime.Now;
this.CreateId= 0;
}
}
}

View File

@ -1,15 +1,79 @@
using System;
using System.Collections.Generic;
using System;
namespace OpenAuth.Domain using System.Collections.Generic;
{ using System.Data;
public partial class UserCfg using System.Linq;
{
public int Id { get; set; } namespace OpenAuth.Domain
public string Theme { get; set; } {
public string Skin { get; set; } /// <summary>
public string NavBarStyle { get; set; } /// 用户ID
public string TabFocusColor { get; set; } /// </summary>
public int NavTabIndex { get; set; } public partial class UserCfg
} {
}
/// <summary>
/// 用户ID
/// </summary>
/// <returns></returns>
public int Id { get; set; }
/// <summary>
/// 用户界面主题
/// </summary>
/// <returns></returns>
public string Theme { get; set; }
/// <summary>
/// 用户界面皮肤
/// </summary>
/// <returns></returns>
public string Skin { get; set; }
/// <summary>
/// 导航条按钮风格
/// </summary>
/// <returns></returns>
public string NavBarStyle { get; set; }
/// <summary>
/// Tab高亮颜色
/// </summary>
/// <returns></returns>
public string TabFocusColor { get; set; }
/// <summary>
/// 导航缺省活动页
/// </summary>
/// <returns></returns>
public int NavTabIndex { get; set; }
public UserCfg()
{
this.Id= 0;
this.Theme= string.Empty;
this.Skin= string.Empty;
this.NavBarStyle= string.Empty;
this.TabFocusColor= string.Empty;
this.NavTabIndex= 0;
}
}
}

View File

@ -1,24 +1,160 @@
using System;
using System.Collections.Generic;
using System;
namespace OpenAuth.Domain using System.Collections.Generic;
{ using System.Data;
public partial class UserExt using System.Linq;
{
public int Id { get; set; } namespace OpenAuth.Domain
public string Email { get; set; } {
public string Phone_ { get; set; } /// <summary>
public string Mobile { get; set; } /// 用户ID
public string Address { get; set; } /// </summary>
public string Zip { get; set; } public partial class UserExt
public string Birthday { get; set; } {
public string IdCard { get; set; }
public string QQ { get; set; } /// <summary>
public string DynamicField { get; set; } /// 用户ID
public int ByteArrayId { get; set; } /// </summary>
public string Remark { get; set; } /// <returns></returns>
public string Field1 { get; set; } public int Id { get; set; }
public string Field2 { get; set; }
public string Field3 { get; set; }
} /// <summary>
} /// 电子邮件
/// </summary>
/// <returns></returns>
public string Email { get; set; }
/// <summary>
/// 固定电话
/// </summary>
/// <returns></returns>
public string Phone_ { get; set; }
/// <summary>
/// 移动电话
/// </summary>
/// <returns></returns>
public string Mobile { get; set; }
/// <summary>
/// 联系地址
/// </summary>
/// <returns></returns>
public string Address { get; set; }
/// <summary>
/// 邮编
/// </summary>
/// <returns></returns>
public string Zip { get; set; }
/// <summary>
/// 生日
/// </summary>
/// <returns></returns>
public string Birthday { get; set; }
/// <summary>
/// 身份证号
/// </summary>
/// <returns></returns>
public string IdCard { get; set; }
/// <summary>
/// QQ
/// </summary>
/// <returns></returns>
public string QQ { get; set; }
/// <summary>
/// 动态扩展字段
/// </summary>
/// <returns></returns>
public string DynamicField { get; set; }
/// <summary>
/// 用户头像流文件ID
/// </summary>
/// <returns></returns>
public int ByteArrayId { get; set; }
/// <summary>
/// 备注
/// </summary>
/// <returns></returns>
public string Remark { get; set; }
/// <summary>
/// 静态扩展字段1
/// </summary>
/// <returns></returns>
public string Field1 { get; set; }
/// <summary>
/// 静态扩展字段2
/// </summary>
/// <returns></returns>
public string Field2 { get; set; }
/// <summary>
/// 静态扩展字段3
/// </summary>
/// <returns></returns>
public string Field3 { get; set; }
public UserExt()
{
this.Id= 0;
this.Email= string.Empty;
this.Phone_= string.Empty;
this.Mobile= string.Empty;
this.Address= string.Empty;
this.Zip= string.Empty;
this.Birthday= string.Empty;
this.IdCard= string.Empty;
this.QQ= string.Empty;
this.DynamicField= string.Empty;
this.ByteArrayId= 0;
this.Remark= string.Empty;
this.Field1= string.Empty;
this.Field2= string.Empty;
this.Field3= string.Empty;
}
}
}

View File

@ -1,15 +1,79 @@
using System;
using System.Collections.Generic;
using System;
namespace OpenAuth.Domain using System.Collections.Generic;
{ using System.Data;
public partial class UserModule using System.Linq;
{
public int Id { get; set; } namespace OpenAuth.Domain
public int UserId { get; set; } {
public int ModuleId { get; set; } /// <summary>
public int Type { get; set; } /// 用户ID
public System.DateTime OperateTime { get; set; } /// </summary>
public int OperatorId { get; set; } public partial class UserModule
} {
}
/// <summary>
/// 用户ID
/// </summary>
/// <returns></returns>
public int Id { get; set; }
/// <summary>
/// 用户流水号
/// </summary>
/// <returns></returns>
public int UserId { get; set; }
/// <summary>
/// 所属功能模块流水号
/// </summary>
/// <returns></returns>
public int ModuleId { get; set; }
/// <summary>
/// 组织类型
/// </summary>
/// <returns></returns>
public int Type { get; set; }
/// <summary>
/// 授权时间
/// </summary>
/// <returns></returns>
public System.DateTime OperateTime { get; set; }
/// <summary>
/// 授权人流水号
/// </summary>
/// <returns></returns>
public int OperatorId { get; set; }
public UserModule()
{
this.Id= 0;
this.UserId= 0;
this.ModuleId= 0;
this.Type= 0;
this.OperateTime= DateTime.Now;
this.OperatorId= 0;
}
}
}

View File

@ -1,14 +1,70 @@
using System;
using System.Collections.Generic;
using System;
namespace OpenAuth.Domain using System.Collections.Generic;
{ using System.Data;
public partial class UserOrg using System.Linq;
{
public int Id { get; set; } namespace OpenAuth.Domain
public int OrgId { get; set; } {
public int UserId { get; set; } /// <summary>
public System.DateTime OperateTime { get; set; } /// 用户ID
public int OperatorId { get; set; } /// </summary>
} public partial class UserOrg
} {
/// <summary>
/// 用户ID
/// </summary>
/// <returns></returns>
public int Id { get; set; }
/// <summary>
///
/// </summary>
/// <returns></returns>
public int OrgId { get; set; }
/// <summary>
/// 用户流水号
/// </summary>
/// <returns></returns>
public int UserId { get; set; }
/// <summary>
/// 授权时间
/// </summary>
/// <returns></returns>
public System.DateTime OperateTime { get; set; }
/// <summary>
/// 授权人流水号
/// </summary>
/// <returns></returns>
public int OperatorId { get; set; }
public UserOrg()
{
this.Id= 0;
this.OrgId= 0;
this.UserId= 0;
this.OperateTime= DateTime.Now;
this.OperatorId= 0;
}
}
}

View File

@ -1,14 +1,70 @@
using System;
using System.Collections.Generic;
using System;
namespace OpenAuth.Domain using System.Collections.Generic;
{ using System.Data;
public partial class UserRole using System.Linq;
{
public int Id { get; set; } namespace OpenAuth.Domain
public int RoleId { get; set; } {
public int UserId { get; set; } /// <summary>
public System.DateTime OperateTime { get; set; } /// 用户ID
public int OperatorId { get; set; } /// </summary>
} public partial class UserRole
} {
/// <summary>
/// 用户ID
/// </summary>
/// <returns></returns>
public int Id { get; set; }
/// <summary>
/// 角色流水号
/// </summary>
/// <returns></returns>
public int RoleId { get; set; }
/// <summary>
/// 用户流水号
/// </summary>
/// <returns></returns>
public int UserId { get; set; }
/// <summary>
/// 授权时间
/// </summary>
/// <returns></returns>
public System.DateTime OperateTime { get; set; }
/// <summary>
/// 授权人流水号
/// </summary>
/// <returns></returns>
public int OperatorId { get; set; }
public UserRole()
{
this.Id= 0;
this.RoleId= 0;
this.UserId= 0;
this.OperateTime= DateTime.Now;
this.OperatorId= 0;
}
}
}

View File

@ -1,73 +1,130 @@
<#@ template hostspecific="true" language="C#" #> <#@ template hostspecific="true" language="C#" #>
<#@ include file="EF.Utility.CS.ttinclude" #><#@ <#@ include file="EF.Utility.CS.ttinclude" #><#@
output extension=".cs" #><# output extension=".cs" #><#
var efHost = (EfTextTemplateHost)Host; var efHost = (EfTextTemplateHost)Host;
var code = new CodeGenerationTools(this); var code = new CodeGenerationTools(this);
#> code.GetSummryDictionary(".",efHost.EntityContainer.Name,efHost.EntityType.Name,"sa","000000");
using System;
using System.Collections.Generic; #>
using System;
namespace OpenAuth.Domain using System.Collections.Generic;
{ using System.Data;
public partial class <#= efHost.EntityType.Name #> using System.Linq;
{
<# namespace OpenAuth.Domain
var collectionNavigations = efHost.EntityType.NavigationProperties.Where( {
np => np.DeclaringType == efHost.EntityType /// <summary>
&& np.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many); /// <#= code.GetSummry(code.Escape(efHost.EntityType.Properties[0])) #>
/// </summary>
// Add a ctor to initialize any collections public partial class <#= efHost.EntityType.Name #>
if (collectionNavigations.Any()) {
{ <#
#> var collectionNavigations = efHost.EntityType.NavigationProperties.Where(np => np.DeclaringType == efHost.EntityType && np.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many);
public <#= code.Escape(efHost.EntityType) #>()
{ foreach (var property in efHost.EntityType.Properties)
<# {
foreach (var navProperty in collectionNavigations) var typeUsage = code.Escape(property.TypeUsage);
{
#> // Fix-up spatial types for EF6
this.<#= code.Escape(navProperty) #> = new List<<#= code.Escape(navProperty.ToEndMember.GetEntityType()) #>>(); if (efHost.EntityFrameworkVersion >= new Version(6, 0)
<# && typeUsage.StartsWith("System.Data.Spatial."))
} {
#> typeUsage = typeUsage.Replace(
} "System.Data.Spatial.",
"System.Data.Entity.Spatial.");
<# }
} #>
/// <summary>
foreach (var property in efHost.EntityType.Properties) /// <#= code.GetSummry(code.Escape(property)) #>
{ /// </summary>
var typeUsage = code.Escape(property.TypeUsage); /// <returns></returns>
<#= Accessibility.ForProperty(property) #> <#= typeUsage #> <#= code.Escape(property) #> { get; set; }
// Fix-up spatial types for EF6
if (efHost.EntityFrameworkVersion >= new Version(6, 0) <#
&& typeUsage.StartsWith("System.Data.Spatial.")) }
{
typeUsage = typeUsage.Replace( foreach (var navProperty in efHost.EntityType.NavigationProperties.Where(np => np.DeclaringType == efHost.EntityType))
"System.Data.Spatial.", {
"System.Data.Entity.Spatial."); if (navProperty.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many)
} {
#> #>
<#= Accessibility.ForProperty(property) #> <#= typeUsage #> <#= code.Escape(property) #> { get; set; } public virtual ICollection<<#= code.Escape(navProperty.ToEndMember.GetEntityType()) #>> <#= code.Escape(navProperty) #> { get; set; }
<# <#
} }
else
foreach (var navProperty in efHost.EntityType.NavigationProperties.Where(np => np.DeclaringType == efHost.EntityType)) {
{ #>
if (navProperty.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many) public virtual <#= code.Escape(navProperty.ToEndMember.GetEntityType()) #> <#= code.Escape(navProperty) #> { get; set; }
{ <#
#> }
public virtual ICollection<<#= code.Escape(navProperty.ToEndMember.GetEntityType()) #>> <#= code.Escape(navProperty) #> { get; set; } }
<# #>
}
else public <#= code.Escape(efHost.EntityType) #>()
{ {
#> <# foreach (var property in efHost.EntityType.Properties)
public virtual <#= code.Escape(navProperty.ToEndMember.GetEntityType()) #> <#= code.Escape(navProperty) #> { get; set; } {
<# var typeUsage = code.Escape(property.TypeUsage);
}
} // Fix-up spatial types for EF6
#> if (efHost.EntityFrameworkVersion >= new Version(6, 0)
} && typeUsage.StartsWith("System.Data.Spatial."))
} {
typeUsage = typeUsage.Replace(
"System.Data.Spatial.",
"System.Data.Entity.Spatial.");
}
if(typeUsage=="System.Guid")
{
#>
this.<#= code.Escape(property) #>= Guid.NewGuid();
<#}
else if(typeUsage=="System.DateTime")
{
#>
this.<#= code.Escape(property) #>= DateTime.Now;
<#}
else if(typeUsage=="bool")
{
#>
this.<#= code.Escape(property) #>= false;
<# }
else if(typeUsage=="int"||typeUsage=="double")
{
#>
this.<#= code.Escape(property) #>= 0;
<# }
else if(typeUsage=="byte[]")
{
#>
this.<#= code.Escape(property) #>= new byte[0];
<# }
else if(typeUsage=="decimal")
{
#>
this.<#= code.Escape(property) #>= 0M;
<# }
else if(typeUsage=="string")
{
#>
this.<#= code.Escape(property) #>= string.Empty;
<#}
else{ }
}
if (collectionNavigations.Any())
{
foreach (var navProperty in collectionNavigations)
{
#>
this.<#= code.Escape(navProperty) #> = new List<<#= code.Escape(navProperty.ToEndMember.GetEntityType()) #>>();
<#
}
}#>
}
}
}

View File

@ -12,8 +12,6 @@ namespace OpenAuth.Repository.Models.Mapping
this.HasKey(t => t.Id); this.HasKey(t => t.Id);
// Properties // Properties
this.Property(t => t.Id);
// Table & Column Mappings // Table & Column Mappings
this.ToTable("ModuleRole"); this.ToTable("ModuleRole");
this.Property(t => t.Id).HasColumnName("Id"); this.Property(t => t.Id).HasColumnName("Id");

View File

@ -12,8 +12,6 @@ namespace OpenAuth.Repository.Models.Mapping
this.HasKey(t => t.Id); this.HasKey(t => t.Id);
// Properties // Properties
this.Property(t => t.Id);
// Table & Column Mappings // Table & Column Mappings
this.ToTable("PageElementGrant"); this.ToTable("PageElementGrant");
this.Property(t => t.Id).HasColumnName("Id"); this.Property(t => t.Id).HasColumnName("Id");

View File

@ -11,7 +11,7 @@ namespace OpenAuth.Repository.Models.Mapping
// Primary Key // Primary Key
this.HasKey(t => t.Id); this.HasKey(t => t.Id);
// Properties
this.Property(t => t.DomId) this.Property(t => t.DomId)
.IsRequired() .IsRequired()
.HasMaxLength(255); .HasMaxLength(255);

View File

@ -11,7 +11,7 @@ namespace OpenAuth.Repository.Models.Mapping
// Primary Key // Primary Key
this.HasKey(t => t.Id); this.HasKey(t => t.Id);
// Properties
this.Property(t => t.Theme) this.Property(t => t.Theme)
.IsRequired() .IsRequired()
.HasMaxLength(255); .HasMaxLength(255);

View File

@ -11,7 +11,7 @@ namespace OpenAuth.Repository.Models.Mapping
// Primary Key // Primary Key
this.HasKey(t => t.Id); this.HasKey(t => t.Id);
// Properties
this.Property(t => t.Email) this.Property(t => t.Email)
.IsRequired() .IsRequired()
.HasMaxLength(255); .HasMaxLength(255);

View File

@ -11,7 +11,7 @@ namespace OpenAuth.Repository.Models.Mapping
// Primary Key // Primary Key
this.HasKey(t => t.Id); this.HasKey(t => t.Id);
// Properties
this.Property(t => t.Account) this.Property(t => t.Account)
.IsRequired() .IsRequired()
.HasMaxLength(255); .HasMaxLength(255);

View File

@ -11,6 +11,7 @@ namespace OpenAuth.Repository.Models.Mapping
// Primary Key // Primary Key
this.HasKey(t => t.Id); this.HasKey(t => t.Id);
// Properties
// Table & Column Mappings // Table & Column Mappings
this.ToTable("UserModule"); this.ToTable("UserModule");
this.Property(t => t.Id).HasColumnName("Id"); this.Property(t => t.Id).HasColumnName("Id");

View File

@ -12,8 +12,6 @@ namespace OpenAuth.Repository.Models.Mapping
this.HasKey(t => t.Id); this.HasKey(t => t.Id);
// Properties // Properties
this.Property(t => t.Id);
// Table & Column Mappings // Table & Column Mappings
this.ToTable("UserOrg"); this.ToTable("UserOrg");
this.Property(t => t.Id).HasColumnName("Id"); this.Property(t => t.Id).HasColumnName("Id");

View File

@ -12,8 +12,6 @@ namespace OpenAuth.Repository.Models.Mapping
this.HasKey(t => t.Id); this.HasKey(t => t.Id);
// Properties // Properties
this.Property(t => t.Id);
// Table & Column Mappings // Table & Column Mappings
this.ToTable("UserRole"); this.ToTable("UserRole");
this.Property(t => t.Id).HasColumnName("Id"); this.Property(t => t.Id).HasColumnName("Id");

View File

@ -79,6 +79,7 @@
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="App.config" />
<None Include="packages.config" /> <None Include="packages.config" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>