mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-04-05 17:38:01 +08:00
53 lines
1.6 KiB
Plaintext
53 lines
1.6 KiB
Plaintext
<%--
|
|
Name: Database Table Properties
|
|
Author: yubaolee
|
|
Description: Create a list of properties from a database table
|
|
--%>
|
|
<%@ CodeTemplate Language="C#" Encoding="utf-8" TargetLanguage="C#" Debug="False" Description="应用层" %>
|
|
<%@ Property Name="ModuleName" Type="String" Category="Context" Description="模块名称" %>
|
|
<%@ Map Name="CSharpAlias" Src="System-CSharpAlias" Description="System to C# Type Map" %>
|
|
<%@ Assembly Name="SchemaExplorer" %>
|
|
<%@ Import Namespace="SchemaExplorer" %>
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using OpenAuth.App.Request;
|
|
using OpenAuth.App.Response;
|
|
using OpenAuth.App.SSO;
|
|
using OpenAuth.Repository.Domain;
|
|
|
|
|
|
namespace OpenAuth.App
|
|
{
|
|
public class <%=ModuleName%>App : BaseApp<<%=ModuleName%>>
|
|
{
|
|
public RevelanceManagerApp ReleManagerApp { get; set; }
|
|
|
|
/// <summary>
|
|
/// 加载列表
|
|
/// </summary>
|
|
public TableData Load(Query<%=ModuleName%>ListReq request)
|
|
{
|
|
return new TableData
|
|
{
|
|
count = Repository.GetCount(null),
|
|
data = Repository.Find(request.page, request.limit, "Id desc")
|
|
};
|
|
}
|
|
|
|
public void Add(<%=ModuleName%> obj)
|
|
{
|
|
Repository.Add(obj);
|
|
}
|
|
|
|
public void Update(<%=ModuleName%> obj)
|
|
{
|
|
UnitWork.Update<<%=ModuleName%>>(u => u.Id == obj.Id, u => new <%=ModuleName%>
|
|
{
|
|
//todo:要修改的字段赋值
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
} |