Update SimpleClient

This commit is contained in:
skx 2020-10-21 14:57:42 +08:00
parent e07d973490
commit c1049eb3ff
3 changed files with 45 additions and 1 deletions

View File

@ -0,0 +1,42 @@
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
namespace SqlSugar
{
public interface ISimpleClient<T> where T : class, new()
{
IDeleteable<T> AsDeleteable();
IInsertable<T> AsInsertable(List<T> insertObjs);
IInsertable<T> AsInsertable(T insertObj);
IInsertable<T> AsInsertable(T[] insertObjs);
ISugarQueryable<T> AsQueryable();
ISqlSugarClient AsSugarClient();
ITenant AsTenant();
IUpdateable<T> AsUpdateable(List<T> updateObjs);
IUpdateable<T> AsUpdateable(T updateObj);
IUpdateable<T> AsUpdateable(T[] updateObjs);
int Count(Expression<Func<T, bool>> whereExpression);
bool Delete(Expression<Func<T, bool>> whereExpression);
bool Delete(T deleteObj);
bool DeleteById(dynamic id);
bool DeleteByIds(dynamic[] ids);
T GetById(dynamic id);
List<T> GetList();
List<T> GetList(Expression<Func<T, bool>> whereExpression);
List<T> GetPageList(Expression<Func<T, bool>> whereExpression, PageModel page);
List<T> GetPageList(Expression<Func<T, bool>> whereExpression, PageModel page, Expression<Func<T, object>> orderByExpression = null, OrderByType orderByType = OrderByType.Asc);
List<T> GetPageList(List<IConditionalModel> conditionalList, PageModel page);
List<T> GetPageList(List<IConditionalModel> conditionalList, PageModel page, Expression<Func<T, object>> orderByExpression = null, OrderByType orderByType = OrderByType.Asc);
T GetSingle(Expression<Func<T, bool>> whereExpression);
bool Insert(T insertObj);
bool InsertRange(List<T> insertObjs);
bool InsertRange(T[] insertObjs);
int InsertReturnIdentity(T insertObj);
bool IsAny(Expression<Func<T, bool>> whereExpression);
bool Update(Expression<Func<T, T>> columns, Expression<Func<T, bool>> whereExpression);
bool Update(T updateObj);
bool UpdateRange(List<T> updateObjs);
bool UpdateRange(T[] updateObjs);
}
}

View File

@ -7,7 +7,7 @@ using System.Text;
namespace SqlSugar
{
public partial class SimpleClient<T> where T : class, new()
public partial class SimpleClient<T> : ISimpleClient<T> where T : class, new()
{
protected ISqlSugarClient Context { get; set; }
@ -171,6 +171,7 @@ namespace SqlSugar
}
[Obsolete("Use SimpleClient<T>")]
public partial class SimpleClient
{
protected ISqlSugarClient Context { get; set; }

View File

@ -134,6 +134,7 @@
<Compile Include="Interface\ISaveable.cs" />
<Compile Include="Interface\ISqlSugarClient.cs" />
<Compile Include="Interface\ITenant.cs" />
<Compile Include="Interface\ISimpleClient.cs" />
<Compile Include="Realization\Oracle\Deleteable\OracleDeleteable.cs" />
<Compile Include="Realization\Oracle\Insertable\OracleInsertable.cs" />
<Compile Include="Realization\Oracle\Updateable\OracleUpdateable.cs" />