mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-09-20 18:47:55 +08:00
转移.net core 3.1,为.NET 5做准备
This commit is contained in:
66
CodeSmith/CSharp/ApiGenerate/ModifyReq.cst
Normal file
66
CodeSmith/CSharp/ApiGenerate/ModifyReq.cst
Normal file
@@ -0,0 +1,66 @@
|
||||
<%@ 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; }
|
||||
<% } %>
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user