<%@ Template Language="C#" TargetLanguage="C#" Debug="True" Encoding="UTF-8" %>

<%@ Assembly Src="../Internal/Model.cs" %>
<%@ Assembly Src="../Internal/Extensions.cs" %>

<%@ Import Namespace="System.Collections.Generic" %>
<%@ Import Namespace="System.Linq" %>
<%@ Import Namespace="System.Text" %>
<%@ Import Namespace="System.Text.RegularExpressions" %>

<%@ Import Namespace="SchemaMapper" %>

<%@ Property Name="Table"
             Type="SchemaExplorer.TableSchema"  %>
             
<%@ Property Name="HeaderModel" 
Type="System.Boolean" 
Category="1.Database"
Default="true"
Description="是否为启用头表模式，即类似‘入库订单’界面" %>

<%@ Property Name="EntityNamespace"
             Type="System.String"  %>
//------------------------------------------------------------------------------
// <autogenerated>
//     This code was generated by a CodeSmith Template.
//
//     DO NOT MODIFY contents of this file. Changes to this
//     file will be lost if the code is regenerated.
//     Author:Yubao Li
// </autogenerated>
//------------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;
using OpenAuth.Repository.Core;

namespace OpenAuth.App.Request
{
    /// <summary>
	/// <%= Table.Description %>
	/// </summary>
    [Table("<%= Table.Name%>")]
    public partial class AddOrUpdate<%= Table.Name %>Req 
    {

        <% foreach(ColumnSchema p in Table.Columns) { 
           
        %>
        /// <summary>
        /// <%=p.Description %>
        /// </summary>
        public <%= p.SystemType.ToNullableType(p.AllowDBNull == true) %> <%= p.Name%> { get; set; }
        <% } %>
        
         //todo:根据自己的业务场景添加需要的字段
    <%
    if(Table.Name.Contains("Tbl") && (!Table.Name.Contains("Dtbl")) && this.HeaderModel){
        var dtblName = Table.Name.Replace("Tbl","Dtbl");  //明细表的表名    
    %>
        public List<AddOrUpdate<%=dtblName%>Req> <%=dtblName%>Reqs { get; set; }
    <% }  %>
    }
}