mirror of
https://github.com/dotnetcore/Util.git
synced 2026-10-28 10:56:37 +08:00
62 lines
2.5 KiB
Plaintext
62 lines
2.5 KiB
Plaintext
<%@ Template Language="C#" TargetLanguage="C#" Debug="True" Encoding="UTF-8" %>
|
|
|
|
<%@ Assembly Src="..\..\..\Common\Model.cs" %>
|
|
<%@ Assembly Src="..\..\..\Common\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="Entity" Type="SchemaMapper.Entity" %>
|
|
<%@ Property Name="Namespace" Type="System.String" %>
|
|
<%-- Safe类名 --%>
|
|
<% string SafeClassName = Entity.ClassName.ToSafeName(); %>
|
|
<%-- 描述 --%>
|
|
<% string Description = Entity.Description; %>
|
|
using System;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using Util;
|
|
using Util.Datas.Queries.Trees;
|
|
|
|
namespace <%= string.Format("{0}.Service.Queries.{1}",Namespace,Entity.TableSchema) %> {
|
|
/// <summary>
|
|
/// <%= Description %>查询参数
|
|
/// </summary>
|
|
public class <%= SafeClassName %>Query : TreeQueryParameter {
|
|
<% foreach(Property p in Entity.Properties) { %>
|
|
<% if( Entity.IsFilterByQueryObject(p) ) continue;%>
|
|
<% if( Entity.IgnoreTreeEntityProperty(p) ) continue;%>
|
|
<% if( p.SystemType == typeof(DateTime) ) {%>
|
|
/// <summary>
|
|
/// 起始<%=p.Description %>
|
|
/// </summary>
|
|
[Display( Name = "起始<%=p.Description %>" )]
|
|
public DateTime? Begin<%= p.PropertyName.ToSafeName() %> { get; set; }
|
|
/// <summary>
|
|
/// 结束<%=p.Description %>
|
|
/// </summary>
|
|
[Display( Name = "结束<%=p.Description %>" )]
|
|
public DateTime? End<%= p.PropertyName.ToSafeName() %> { get; set; }
|
|
<%continue;}%>
|
|
<% if( p.SystemType == typeof(string) ) {%>
|
|
|
|
private <%= p.SystemType.ToNullableType(true) %> <%= p.PropertyName.ToFieldName() %> = string.Empty;
|
|
/// <summary>
|
|
/// <%=p.Description %>
|
|
/// </summary>
|
|
[Display(Name="<%=p.Description %>")]
|
|
public <%= p.SystemType.ToNullableType(true) %> <%= p.PropertyName.ToSafeName() %> {
|
|
get => <%= p.PropertyName.ToFieldName() %> == null ? string.Empty : <%= p.PropertyName.ToFieldName() %>.Trim();
|
|
set => <%= p.PropertyName.ToFieldName() %> = value;
|
|
}
|
|
<%continue;} %>
|
|
/// <summary>
|
|
/// <%=p.Description %>
|
|
/// </summary>
|
|
[Display(Name="<%=p.Description %>")]
|
|
public <%= p.SystemType.ToNullableType(true) %> <%= p.PropertyName.ToSafeName() %> { get; set; }
|
|
<% } %>
|
|
}
|
|
} |