基类模型修改为接口
This commit is contained in:
@@ -4,7 +4,7 @@ using Yi.Framework.Model.Models;
|
||||
|
||||
namespace Yi.Framework.Repository
|
||||
{
|
||||
public class DataContext<T> : SimpleClient<T> where T : class, BaseModelEntity, new()
|
||||
public class DataContext<T> : SimpleClient<T> where T : class, IBaseModelEntity, new()
|
||||
{
|
||||
public DataContext(ISqlSugarClient context) : base(context)
|
||||
{
|
||||
|
||||
@@ -11,7 +11,7 @@ using Yi.Framework.Model.Query;
|
||||
|
||||
namespace Yi.Framework.Repository
|
||||
{
|
||||
public interface IRepository<T> : ISimpleClient<T> where T : BaseModelEntity,new()
|
||||
public interface IRepository<T> : ISimpleClient<T> where T : class, IBaseModelEntity, new()
|
||||
{
|
||||
public ISqlSugarClient _Db { get; set; }
|
||||
public Task<bool> UseTranAsync(Func<Task> func);
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Yi.Framework.Repository
|
||||
/// 仓储模式
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
public class Repository<T> : DataContext<T>, IRepository<T> where T : BaseModelEntity,new()
|
||||
public class Repository<T> : DataContext<T>, IRepository<T> where T : class, IBaseModelEntity, new()
|
||||
{
|
||||
public ISqlSugarClient _Db { get; set; }
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user