mirror of
https://github.com/dotnetcore/Util.git
synced 2026-10-21 14:51:58 +08:00
52 lines
2.1 KiB
Plaintext
52 lines
2.1 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" %>
|
|
<%@ Property Name="UnitOfWork" Type="System.String" %>
|
|
<%@ Property Name="IUnitOfWorkNamespace" Type="System.String" %>
|
|
<%-- Safe类名 --%>
|
|
<% string SafeClassName = Entity.ClassName.ToSafeName(); %>
|
|
<%-- 描述 --%>
|
|
<% string Description = Entity.Description; %>
|
|
using <%= Entity.GetNamespace(Namespace,"Domain","Models") %>;
|
|
using <%= Entity.GetNamespace(Namespace,"Domain","Repositories") %>;
|
|
using Util.Datas.Ef.Core;
|
|
|
|
<%
|
|
if( Entity.IsTreeEntity() ){ %>
|
|
namespace <%= Namespace %>.Data.Repositories.<%= Entity.TableSchema %> {
|
|
/// <summary>
|
|
/// <%= Description %>仓储
|
|
/// </summary>
|
|
public class <%= SafeClassName %>Repository : TreeRepositoryBase<<%= SafeClassName %><%= Entity.GetKeyTypeNoContainsGuid() %>>, I<%= SafeClassName %>Repository {
|
|
/// <summary>
|
|
/// 初始化<%= Description %>仓储
|
|
/// </summary>
|
|
/// <param name="unitOfWork">工作单元</param>
|
|
public <%= SafeClassName %>Repository( I<%= UnitOfWork %> unitOfWork ) : base( unitOfWork ) {
|
|
}
|
|
}
|
|
}
|
|
<% return;}%>
|
|
namespace <%= Namespace %>.Data.Repositories.<%= Entity.TableSchema %> {
|
|
/// <summary>
|
|
/// <%= Description %>仓储
|
|
/// </summary>
|
|
public class <%= SafeClassName %>Repository : RepositoryBase<<%= SafeClassName %><%= Entity.GetKeyTypeNoContainsGuid() %>>, I<%= SafeClassName %>Repository {
|
|
/// <summary>
|
|
/// 初始化<%= Description %>仓储
|
|
/// </summary>
|
|
/// <param name="unitOfWork">工作单元</param>
|
|
public <%= SafeClassName %>Repository( I<%= UnitOfWork %> unitOfWork ) : base( unitOfWork ) {
|
|
}
|
|
}
|
|
} |