%@ 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) %> {
///
/// <%= Description %>查询参数
///
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) ) {%>
///
/// 起始<%=p.Description %>
///
[Display( Name = "起始<%=p.Description %>" )]
public DateTime? Begin<%= p.PropertyName.ToSafeName() %> { get; set; }
///
/// 结束<%=p.Description %>
///
[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;
///
/// <%=p.Description %>
///
[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;} %>
///
/// <%=p.Description %>
///
[Display(Name="<%=p.Description %>")]
public <%= p.SystemType.ToNullableType(true) %> <%= p.PropertyName.ToSafeName() %> { get; set; }
<% } %>
}
}