调整代码生成器

This commit is contained in:
yubaolee 2021-03-14 23:38:11 +08:00
parent d222e8ba39
commit 3e72144f21
5 changed files with 2 additions and 34 deletions

View File

@ -19,9 +19,6 @@ namespace OpenAuth.App
{ {
public BaseIntAutoGenApp(IUnitWork<TDbContext> unitWork, IRepository<T,TDbContext> repository, IAuth auth) : base(unitWork, repository, auth) public BaseIntAutoGenApp(IUnitWork<TDbContext> unitWork, IRepository<T,TDbContext> repository, IAuth auth) : base(unitWork, repository, auth)
{ {
UnitWork = unitWork;
Repository = repository;
_auth = auth;
} }
/// <summary> /// <summary>

View File

@ -16,24 +16,10 @@ namespace OpenAuth.App
/// <typeparam name="T"></typeparam> /// <typeparam name="T"></typeparam>
public class BaseLongApp<T, TDbContext> :BaseApp<T,TDbContext> where T : LongEntity where TDbContext: DbContext public class BaseLongApp<T, TDbContext> :BaseApp<T,TDbContext> where T : LongEntity where TDbContext: DbContext
{ {
/// <summary>
/// 用于普通的数据库操作
/// </summary>
protected IRepository<T, TDbContext> Repository;
/// <summary>
/// 用于事务操作
/// <para>使用详见http://doc.openauth.me/core/unitwork.html</para>
/// </summary>
protected IUnitWork<TDbContext> UnitWork;
protected IAuth _auth;
public BaseLongApp(IUnitWork<TDbContext> unitWork, IRepository<T,TDbContext> repository, IAuth auth) : base(unitWork, repository,auth) public BaseLongApp(IUnitWork<TDbContext> unitWork, IRepository<T,TDbContext> repository, IAuth auth) : base(unitWork, repository,auth)
{ {
UnitWork = unitWork;
Repository = repository;
_auth = auth;
} }

View File

@ -16,24 +16,9 @@ namespace OpenAuth.App
/// <typeparam name="T"></typeparam> /// <typeparam name="T"></typeparam>
public class BaseStringApp<T, TDbContext> :BaseApp<T,TDbContext> where T : StringEntity where TDbContext: DbContext public class BaseStringApp<T, TDbContext> :BaseApp<T,TDbContext> where T : StringEntity where TDbContext: DbContext
{ {
/// <summary>
/// 用于普通的数据库操作
/// </summary>
protected IRepository<T, TDbContext> Repository;
/// <summary>
/// 用于事务操作
/// <para>使用详见http://doc.openauth.me/core/unitwork.html</para>
/// </summary>
protected IUnitWork<TDbContext> UnitWork;
protected IAuth _auth;
public BaseStringApp(IUnitWork<TDbContext> unitWork, IRepository<T,TDbContext> repository, IAuth auth) : base(unitWork, repository, auth) public BaseStringApp(IUnitWork<TDbContext> unitWork, IRepository<T,TDbContext> repository, IAuth auth) : base(unitWork, repository, auth)
{ {
UnitWork = unitWork;
Repository = repository;
_auth = auth;
} }
/// <summary> /// <summary>

View File

@ -12,7 +12,7 @@ using OpenAuth.Repository.Interface;
namespace OpenAuth.App namespace OpenAuth.App
{ {
public class {ModuleCode} : BaseApp<{ClassName},OpenAuthDBContext> public class {ModuleCode} : BaseStringApp<{ClassName},OpenAuthDBContext>
{ {
/// <summary> /// <summary>

View File

@ -13,7 +13,7 @@ using OpenAuth.Repository.Core;
namespace OpenAuth.Repository.Domain namespace OpenAuth.Repository.Domain
{ {
{AttributeManager} {AttributeManager}
public class {ClassName} : Entity public class {ClassName} : StringEntity
{ {
public {ClassName}() public {ClassName}()
{ {