diff --git a/OpenAuth.App/AppManager.cs b/OpenAuth.App/AppManager.cs
index f200e689..506183d6 100644
--- a/OpenAuth.App/AppManager.cs
+++ b/OpenAuth.App/AppManager.cs
@@ -4,6 +4,7 @@ using System.Linq;
using System.Threading.Tasks;
using OpenAuth.App.Interface;
using OpenAuth.App.Request;
+using OpenAuth.Repository;
using OpenAuth.Repository.Domain;
using OpenAuth.Repository.Interface;
@@ -12,7 +13,7 @@ namespace OpenAuth.App
///
/// 分类管理
///
- public class AppManager : BaseApp
+ public class AppManager : BaseApp
{
public void Add(Application Application)
{
@@ -36,7 +37,7 @@ namespace OpenAuth.App
return applications.ToList();
}
- public AppManager(IUnitWork unitWork, IRepository repository,IAuth auth) : base(unitWork, repository, auth)
+ public AppManager(IUnitWork unitWork, IRepository repository,IAuth auth) : base(unitWork, repository, auth)
{
}
}
diff --git a/OpenAuth.App/AuthContextFactory.cs b/OpenAuth.App/AuthContextFactory.cs
index 8952e951..6bd10143 100644
--- a/OpenAuth.App/AuthContextFactory.cs
+++ b/OpenAuth.App/AuthContextFactory.cs
@@ -14,6 +14,7 @@
//
// ***********************************************************************
+using OpenAuth.Repository;
using OpenAuth.Repository.Domain;
using OpenAuth.Repository.Interface;
@@ -27,11 +28,11 @@ namespace OpenAuth.App
{
private SystemAuthStrategy _systemAuth;
private NormalAuthStrategy _normalAuthStrategy;
- private readonly IUnitWork _unitWork;
+ private readonly IUnitWork _unitWork;
public AuthContextFactory(SystemAuthStrategy sysStrategy
, NormalAuthStrategy normalAuthStrategy
- , IUnitWork unitWork)
+ , IUnitWork unitWork)
{
_systemAuth = sysStrategy;
_normalAuthStrategy = normalAuthStrategy;
diff --git a/OpenAuth.App/AuthStrategies/NormalAuthStrategy.cs b/OpenAuth.App/AuthStrategies/NormalAuthStrategy.cs
index 0b68efa5..e4ace75e 100644
--- a/OpenAuth.App/AuthStrategies/NormalAuthStrategy.cs
+++ b/OpenAuth.App/AuthStrategies/NormalAuthStrategy.cs
@@ -19,6 +19,7 @@ using System.Collections.Generic;
using System.Linq;
using Infrastructure;
using OpenAuth.App.Response;
+using OpenAuth.Repository;
using OpenAuth.Repository.Domain;
using OpenAuth.Repository.Interface;
@@ -27,7 +28,7 @@ namespace OpenAuth.App
///
/// 普通用户授权策略
///
- public class NormalAuthStrategy :BaseApp, IAuthStrategy
+ public class NormalAuthStrategy :BaseApp, IAuthStrategy
{
protected User _user;
@@ -134,7 +135,7 @@ namespace OpenAuth.App
//用户角色
- public NormalAuthStrategy(IUnitWork unitWork, IRepository repository, DbExtension dbExtension) : base(unitWork, repository,null)
+ public NormalAuthStrategy(IUnitWork unitWork, IRepository repository, DbExtension dbExtension) : base(unitWork, repository,null)
{
_dbExtension = dbExtension;
}
diff --git a/OpenAuth.App/AuthStrategies/SystemAuthStrategy.cs b/OpenAuth.App/AuthStrategies/SystemAuthStrategy.cs
index b3800c6f..4f4dd06d 100644
--- a/OpenAuth.App/AuthStrategies/SystemAuthStrategy.cs
+++ b/OpenAuth.App/AuthStrategies/SystemAuthStrategy.cs
@@ -19,6 +19,7 @@ using System.Collections.Generic;
using System.Linq;
using Infrastructure;
using OpenAuth.App.Response;
+using OpenAuth.Repository;
using OpenAuth.Repository.Domain;
using OpenAuth.Repository.Interface;
@@ -29,7 +30,7 @@ namespace OpenAuth.App
/// 超级管理员权限
/// 超级管理员使用guid.empty为ID,可以根据需要修改
///
- public class SystemAuthStrategy : BaseApp, IAuthStrategy
+ public class SystemAuthStrategy : BaseApp, IAuthStrategy
{
protected User _user;
private DbExtension _dbExtension;
@@ -97,7 +98,7 @@ namespace OpenAuth.App
}
- public SystemAuthStrategy(IUnitWork unitWork, IRepository repository, DbExtension dbExtension) : base(unitWork, repository, null)
+ public SystemAuthStrategy(IUnitWork unitWork, IRepository repository, DbExtension dbExtension) : base(unitWork, repository, null)
{
_dbExtension = dbExtension;
_user = new User
diff --git a/OpenAuth.App/AutofacExt.cs b/OpenAuth.App/AutofacExt.cs
index bf37e6ad..12d19a98 100644
--- a/OpenAuth.App/AutofacExt.cs
+++ b/OpenAuth.App/AutofacExt.cs
@@ -41,8 +41,8 @@ namespace OpenAuth.App
var builder = new ContainerBuilder();
//注册数据库基础操作和工作单元
- services.AddScoped(typeof(IRepository<>), typeof(BaseRepository<>));
- services.AddScoped(typeof(IUnitWork), typeof(UnitWork));
+ services.AddScoped(typeof(IRepository<,>), typeof(BaseRepository<,>));
+ services.AddScoped(typeof(IUnitWork<>), typeof(UnitWork<>));
//注入授权
builder.RegisterType(typeof(LocalAuth)).As(typeof(IAuth));
@@ -77,8 +77,8 @@ namespace OpenAuth.App
{
//注册数据库基础操作和工作单元
- builder.RegisterGeneric(typeof(BaseRepository<>)).As(typeof(IRepository<>));
- builder.RegisterType(typeof(UnitWork)).As(typeof(IUnitWork));
+ builder.RegisterGeneric(typeof(BaseRepository<,>)).As(typeof(IRepository<,>));
+ builder.RegisterGeneric(typeof(UnitWork<>)).As(typeof(IUnitWork<>));
//注入授权
builder.RegisterType(typeof(LocalAuth)).As(typeof(IAuth));
diff --git a/OpenAuth.App/BaseApp.cs b/OpenAuth.App/BaseApp.cs
index 173361b1..96238a59 100644
--- a/OpenAuth.App/BaseApp.cs
+++ b/OpenAuth.App/BaseApp.cs
@@ -1,6 +1,7 @@
using System;
using System.Linq;
using Infrastructure;
+using Microsoft.EntityFrameworkCore;
using OpenAuth.App.Interface;
using OpenAuth.Repository.Core;
using OpenAuth.Repository.Domain;
@@ -13,22 +14,22 @@ namespace OpenAuth.App
/// 如用户管理:Class UserManagerApp:BaseApp
///
///
- public class BaseApp where T : Entity
+ public class BaseApp where T : Entity where TDbContext: DbContext
{
///
/// 用于普通的数据库操作
///
- protected IRepository Repository;
+ protected IRepository Repository;
///
/// 用于事务操作
/// 使用详见:http://doc.openauth.me/core/unitwork.html
///
- protected IUnitWork UnitWork;
+ protected IUnitWork UnitWork;
protected IAuth _auth;
- public BaseApp(IUnitWork unitWork, IRepository repository, IAuth auth)
+ public BaseApp(IUnitWork unitWork, IRepository repository, IAuth auth)
{
UnitWork = unitWork;
Repository = repository;
diff --git a/OpenAuth.App/BaseTreeApp.cs b/OpenAuth.App/BaseTreeApp.cs
index 31297c99..099b3c89 100644
--- a/OpenAuth.App/BaseTreeApp.cs
+++ b/OpenAuth.App/BaseTreeApp.cs
@@ -1,4 +1,5 @@
using System.Linq;
+using Microsoft.EntityFrameworkCore;
using OpenAuth.App.Interface;
using OpenAuth.Repository.Core;
using OpenAuth.Repository.Interface;
@@ -9,11 +10,11 @@ namespace OpenAuth.App
/// 树状结构处理
///
///
- public class BaseTreeApp :BaseApp where T : TreeEntity
+ public class BaseTreeApp :BaseApp where T : TreeEntity where TDbContext :DbContext
{
- public BaseTreeApp(IUnitWork unitWork, IRepository repository, IAuth auth)
+ public BaseTreeApp(IUnitWork unitWork, IRepository repository, IAuth auth)
: base(unitWork, repository,auth)
{
}
diff --git a/OpenAuth.App/BuilderTableApp.cs b/OpenAuth.App/BuilderTableApp.cs
index 56f7a926..72577765 100644
--- a/OpenAuth.App/BuilderTableApp.cs
+++ b/OpenAuth.App/BuilderTableApp.cs
@@ -16,6 +16,7 @@ using Microsoft.Extensions.Options;
using OpenAuth.App.Interface;
using OpenAuth.App.Request;
using OpenAuth.App.Response;
+using OpenAuth.Repository;
using OpenAuth.Repository.Core;
using OpenAuth.Repository.Domain;
using OpenAuth.Repository.Interface;
@@ -23,7 +24,7 @@ using OpenAuth.Repository.Interface;
namespace OpenAuth.App
{
- public class BuilderTableApp : BaseApp
+ public class BuilderTableApp : BaseApp
{
private BuilderTableColumnApp _builderTableColumnApp;
private CategoryApp _categoryApp;
@@ -33,7 +34,7 @@ namespace OpenAuth.App
private string _startName = "";
private IOptions _appConfiguration;
- public BuilderTableApp(IUnitWork unitWork, IRepository repository,
+ public BuilderTableApp(IUnitWork unitWork, IRepository repository,
RevelanceManagerApp app, IAuth auth, DbExtension dbExtension, BuilderTableColumnApp builderTableColumnApp,
IOptions appConfiguration, CategoryApp categoryApp) : base(unitWork, repository, auth)
{
diff --git a/OpenAuth.App/BuilderTableColumnApp.cs b/OpenAuth.App/BuilderTableColumnApp.cs
index 8b7994a8..3dce69ac 100644
--- a/OpenAuth.App/BuilderTableColumnApp.cs
+++ b/OpenAuth.App/BuilderTableColumnApp.cs
@@ -6,15 +6,16 @@ using Infrastructure;
using OpenAuth.App.Interface;
using OpenAuth.App.Request;
using OpenAuth.App.Response;
+using OpenAuth.Repository;
using OpenAuth.Repository.Domain;
using OpenAuth.Repository.Interface;
namespace OpenAuth.App
{
- public class BuilderTableColumnApp : BaseApp
+ public class BuilderTableColumnApp : BaseApp
{
- public BuilderTableColumnApp(IUnitWork unitWork, IRepository repository,
+ public BuilderTableColumnApp(IUnitWork unitWork, IRepository repository,
IAuth auth) : base(unitWork, repository,auth)
{
}
diff --git a/OpenAuth.App/CategoryApp.cs b/OpenAuth.App/CategoryApp.cs
index 8b3a1537..cd8bb5e1 100644
--- a/OpenAuth.App/CategoryApp.cs
+++ b/OpenAuth.App/CategoryApp.cs
@@ -6,13 +6,14 @@ using Infrastructure;
using OpenAuth.App.Interface;
using OpenAuth.App.Request;
using OpenAuth.App.Response;
+using OpenAuth.Repository;
using OpenAuth.Repository.Domain;
using OpenAuth.Repository.Interface;
namespace OpenAuth.App
{
- public class CategoryApp : BaseApp
+ public class CategoryApp : BaseApp
{
///
/// 加载列表
@@ -90,7 +91,7 @@ namespace OpenAuth.App
return Repository.Find(u => u.TypeId == typeId).ToList();
}
- public CategoryApp(IUnitWork unitWork, IRepository repository,IAuth auth) : base(unitWork, repository, auth)
+ public CategoryApp(IUnitWork unitWork, IRepository repository,IAuth auth) : base(unitWork, repository, auth)
{
}
}
diff --git a/OpenAuth.App/CategoryTypeApp.cs b/OpenAuth.App/CategoryTypeApp.cs
index f75544d7..079a2084 100644
--- a/OpenAuth.App/CategoryTypeApp.cs
+++ b/OpenAuth.App/CategoryTypeApp.cs
@@ -6,13 +6,14 @@ using Infrastructure;
using OpenAuth.App.Interface;
using OpenAuth.App.Request;
using OpenAuth.App.Response;
+using OpenAuth.Repository;
using OpenAuth.Repository.Domain;
using OpenAuth.Repository.Interface;
namespace OpenAuth.App
{
- public class CategoryTypeApp : BaseApp
+ public class CategoryTypeApp : BaseApp
{
private RevelanceManagerApp _revelanceApp;
@@ -71,7 +72,7 @@ namespace OpenAuth.App
return UnitWork.Find(null).ToList();
}
- public CategoryTypeApp(IUnitWork unitWork, IRepository repository,
+ public CategoryTypeApp(IUnitWork unitWork, IRepository repository,
RevelanceManagerApp app, IAuth auth) : base(unitWork, repository,auth)
{
_revelanceApp = app;
diff --git a/OpenAuth.App/DataPrivilegeRuleApp.cs b/OpenAuth.App/DataPrivilegeRuleApp.cs
index 9e3353ae..87544f5c 100644
--- a/OpenAuth.App/DataPrivilegeRuleApp.cs
+++ b/OpenAuth.App/DataPrivilegeRuleApp.cs
@@ -5,13 +5,14 @@ using Infrastructure;
using OpenAuth.App.Interface;
using OpenAuth.App.Request;
using OpenAuth.App.Response;
+using OpenAuth.Repository;
using OpenAuth.Repository.Domain;
using OpenAuth.Repository.Interface;
namespace OpenAuth.App
{
- public class DataPrivilegeRuleApp : BaseApp
+ public class DataPrivilegeRuleApp : BaseApp
{
private RevelanceManagerApp _revelanceApp;
///
@@ -78,7 +79,7 @@ namespace OpenAuth.App
}
- public DataPrivilegeRuleApp(IUnitWork unitWork, IRepository repository,
+ public DataPrivilegeRuleApp(IUnitWork unitWork, IRepository repository,
RevelanceManagerApp app, IAuth auth) : base(unitWork, repository, auth)
{
_revelanceApp = app;
diff --git a/OpenAuth.App/FileApp.cs b/OpenAuth.App/FileApp.cs
index 50776e18..14b68273 100644
--- a/OpenAuth.App/FileApp.cs
+++ b/OpenAuth.App/FileApp.cs
@@ -12,6 +12,7 @@ using Microsoft.Extensions.Options;
using OpenAuth.App.Interface;
using OpenAuth.App.Request;
using OpenAuth.App.Response;
+using OpenAuth.Repository;
using OpenAuth.Repository.Domain;
using OpenAuth.Repository.Interface;
@@ -20,14 +21,14 @@ namespace OpenAuth.App
///
/// 文件管理
///
- public class FileApp : BaseApp
+ public class FileApp : BaseApp
{
private ILogger _logger;
private string _filePath;
private string _dbFilePath; //数据库中的文件路径
private string _dbThumbnail; //数据库中的缩略图路径
- public FileApp(IOptions setOptions, IUnitWork unitWork, IRepository repository,
+ public FileApp(IOptions setOptions, IUnitWork unitWork, IRepository repository,
ILogger logger, IAuth auth)
: base(unitWork, repository, auth)
{
diff --git a/OpenAuth.App/FlowInstanceApp.cs b/OpenAuth.App/FlowInstanceApp.cs
index 78dbbfcb..f03c7229 100644
--- a/OpenAuth.App/FlowInstanceApp.cs
+++ b/OpenAuth.App/FlowInstanceApp.cs
@@ -26,13 +26,14 @@ using System.Linq.Expressions;
using System.Net.Http;
using System.Threading.Tasks;
using Infrastructure.Helpers;
+using OpenAuth.Repository;
namespace OpenAuth.App
{
///
/// 工作流实例表操作
///
- public class FlowInstanceApp : BaseApp
+ public class FlowInstanceApp : BaseApp
{
private RevelanceManagerApp _revelanceApp;
private FlowSchemeApp _flowSchemeApp;
@@ -551,7 +552,7 @@ namespace OpenAuth.App
});
}
- public FlowInstanceApp(IUnitWork unitWork, IRepository repository
+ public FlowInstanceApp(IUnitWork unitWork, IRepository repository
, RevelanceManagerApp app, FlowSchemeApp flowSchemeApp, FormApp formApp, IHttpClientFactory httpClientFactory,IAuth auth, IServiceProvider serviceProvider)
: base(unitWork, repository, auth)
{
diff --git a/OpenAuth.App/FlowSchemeApp.cs b/OpenAuth.App/FlowSchemeApp.cs
index ed166723..a2578ecc 100644
--- a/OpenAuth.App/FlowSchemeApp.cs
+++ b/OpenAuth.App/FlowSchemeApp.cs
@@ -4,12 +4,13 @@ using System.Threading.Tasks;
using OpenAuth.App.Interface;
using OpenAuth.App.Request;
using OpenAuth.App.Response;
+using OpenAuth.Repository;
using OpenAuth.Repository.Domain;
using OpenAuth.Repository.Interface;
namespace OpenAuth.App
{
- public class FlowSchemeApp :BaseApp
+ public class FlowSchemeApp :BaseApp
{
public void Add(FlowScheme flowScheme)
{
@@ -65,7 +66,7 @@ namespace OpenAuth.App
return result;
}
- public FlowSchemeApp(IUnitWork unitWork, IRepository repository,IAuth auth) : base(unitWork, repository, auth)
+ public FlowSchemeApp(IUnitWork unitWork, IRepository repository,IAuth auth) : base(unitWork, repository, auth)
{
}
}
diff --git a/OpenAuth.App/FormApp.cs b/OpenAuth.App/FormApp.cs
index 8f7d1ae6..2b180a7a 100644
--- a/OpenAuth.App/FormApp.cs
+++ b/OpenAuth.App/FormApp.cs
@@ -6,13 +6,14 @@ using Microsoft.Extensions.Options;
using OpenAuth.App.Interface;
using OpenAuth.App.Request;
using OpenAuth.App.Response;
+using OpenAuth.Repository;
using OpenAuth.Repository.Domain;
using OpenAuth.Repository.Interface;
namespace OpenAuth.App
{
- public class FormApp : BaseApp