diff --git a/Src/Asp.Net/SqlSugar/Interface/ISqlSugarClient.cs b/Src/Asp.Net/SqlSugar/Interface/ISqlSugarClient.cs new file mode 100644 index 000000000..f403655ba --- /dev/null +++ b/Src/Asp.Net/SqlSugar/Interface/ISqlSugarClient.cs @@ -0,0 +1,123 @@ +using System; +using System.Collections.Generic; +using System.Dynamic; +using System.Linq.Expressions; +using System.Threading.Tasks; + +namespace SqlSugar +{ + public interface ISqlSugarClient + { + IAdo Ado { get; } + AopProvider Aop { get; } + ICodeFirst CodeFirst { get; } + SqlSugarClient Context { get; set; } + Guid ContextID { get; set; } + ConnectionConfig CurrentConnectionConfig { get; set; } + IDbFirst DbFirst { get; } + IDbMaintenance DbMaintenance { get; } + EntityMaintenance EntityMaintenance { get; set; } + EntityMaintenance EntityProvider { get; set; } + bool IsSystemTablesConfig { get; } + QueryFilterProvider QueryFilter { get; set; } + IContextMethods RewritableMethods { get; set; } + SimpleClient SimpleClient { get; } + Dictionary TempItems { get; set; } + IContextMethods Utilities { get; set; } + + void AddQueue(string sql, SugarParameter parsmeter); + void AddQueue(string sql, List parsmeters); + void AddQueue(string sql, object parsmeters = null); + void Close(); + IDeleteable Deleteable() where T : class, new(); + IDeleteable Deleteable(T deleteObj) where T : class, new(); + IDeleteable Deleteable(List pkValue) where T : class, new(); + IDeleteable Deleteable(List deleteObjs) where T : class, new(); + IDeleteable Deleteable(Expression> expression) where T : class, new(); + IDeleteable Deleteable(dynamic[] primaryKeyValues) where T : class, new(); + IDeleteable Deleteable(dynamic primaryKeyValue) where T : class, new(); + void Dispose(); + DateTime GetDate(); + SimpleClient GetSimpleClient(); + SimpleClient GetSimpleClient() where T : class, new(); + void InitMppingInfo(Type type); + IInsertable Insertable(T[] insertObjs) where T : class, new(); + IInsertable Insertable(List insertObjs) where T : class, new(); + IInsertable Insertable(T insertObj) where T : class, new(); + IInsertable Insertable(dynamic insertDynamicObject) where T : class, new(); + IInsertable Insertable(Dictionary columnDictionary) where T : class, new(); + void Open(); + ISugarQueryable Queryable(string tableName, string shortName); + ISugarQueryable Queryable(); + ISugarQueryable Queryable(string shortName); + ISugarQueryable Queryable(ISugarQueryable queryable) where T : class, new(); + ISugarQueryable Queryable(Expression> joinExpression); + ISugarQueryable Queryable(Expression> joinExpression); + ISugarQueryable Queryable(Expression> joinExpression) where T : class, new(); + ISugarQueryable Queryable(ISugarQueryable joinQueryable1, ISugarQueryable joinQueryable2, Expression> joinExpression) + where T : class, new() + where T2 : class, new(); + ISugarQueryable Queryable(ISugarQueryable joinQueryable1, ISugarQueryable joinQueryable2, JoinType joinType, Expression> joinExpression) + where T : class, new() + where T2 : class, new(); + ISugarQueryable Queryable(Expression> joinExpression); + ISugarQueryable Queryable(Expression> joinExpression); + ISugarQueryable Queryable(Expression> joinExpression) where T : class, new(); + ISugarQueryable Queryable(Expression> joinExpression); + ISugarQueryable Queryable(Expression> joinExpression); + ISugarQueryable Queryable(Expression> joinExpression) where T : class, new(); + ISugarQueryable Queryable(Expression> joinExpression); + ISugarQueryable Queryable(Expression> joinExpression); + ISugarQueryable Queryable(Expression> joinExpression) where T : class, new(); + ISugarQueryable Queryable(Expression> joinExpression); + ISugarQueryable Queryable(Expression> joinExpression); + ISugarQueryable Queryable(Expression> joinExpression) where T : class, new(); + ISugarQueryable Queryable(Expression> joinExpression); + ISugarQueryable Queryable(Expression> joinExpression); + ISugarQueryable Queryable(Expression> joinExpression) where T : class, new(); + ISugarQueryable Queryable(Expression> joinExpression); + ISugarQueryable Queryable(Expression> joinExpression); + ISugarQueryable Queryable(Expression> joinExpression) where T : class, new(); + ISugarQueryable Queryable(Expression> joinExpression); + ISugarQueryable Queryable(Expression> joinExpression); + ISugarQueryable Queryable(Expression> joinExpression) where T : class, new(); + ISugarQueryable Queryable(Expression> joinExpression); + ISugarQueryable Queryable(Expression> joinExpression); + ISugarQueryable Queryable(Expression> joinExpression) where T : class, new(); + ISugarQueryable Queryable(Expression> joinExpression); + ISugarQueryable Queryable(Expression> joinExpression); + ISugarQueryable Queryable(Expression> joinExpression) where T : class, new(); + ISugarQueryable Queryable(Expression> joinExpression); + ISugarQueryable Queryable(Expression> joinExpression); + ISugarQueryable Queryable(Expression> joinExpression) where T : class, new(); + ISaveable Saveable(T saveObject) where T : class, new(); + ISaveable Saveable(List saveObjects) where T : class, new(); + int SaveQueues(bool isTran = true); + List SaveQueues(bool isTran = true); + Tuple, List> SaveQueues(bool isTran = true); + Tuple, List, List> SaveQueues(bool isTran = true); + Tuple, List, List, List> SaveQueues(bool isTran = true); + Tuple, List, List, List, List> SaveQueues(bool isTran = true); + Tuple, List, List, List, List, List> SaveQueues(bool isTran = true); + Tuple, List, List, List, List, List, List> SaveQueues(bool isTran = true); + Task SaveQueuesAsync(bool isTran = true); + Task> SaveQueuesAsync(bool isTran = true); + Task, List>> SaveQueuesAsync(bool isTran = true); + Task, List, List>> SaveQueuesAsync(bool isTran = true); + Task, List, List, List>> SaveQueuesAsync(bool isTran = true); + Task, List, List, List, List>> SaveQueuesAsync(bool isTran = true); + Task, List, List, List, List, List>> SaveQueuesAsync(bool isTran = true); + Task, List, List, List, List, List, List>> SaveQueuesAsync(bool isTran = true); + ISugarQueryable SqlQueryable(string sql) where T : class, new(); + ISugarQueryable Union(params ISugarQueryable[] queryables) where T : class, new(); + ISugarQueryable Union(List> queryables) where T : class, new(); + ISugarQueryable UnionAll(params ISugarQueryable[] queryables) where T : class, new(); + ISugarQueryable UnionAll(List> queryables) where T : class, new(); + IUpdateable Updateable() where T : class, new(); + IUpdateable Updateable(T[] UpdateObjs) where T : class, new(); + IUpdateable Updateable(List UpdateObjs) where T : class, new(); + IUpdateable Updateable(T UpdateObj) where T : class, new(); + IUpdateable Updateable(dynamic updateDynamicObject) where T : class, new(); + IUpdateable Updateable(Dictionary columnDictionary) where T : class, new(); + } +} \ No newline at end of file diff --git a/Src/Asp.Net/SqlSugar/SqlSugar.csproj b/Src/Asp.Net/SqlSugar/SqlSugar.csproj index a5368a1d0..f39e80914 100644 --- a/Src/Asp.Net/SqlSugar/SqlSugar.csproj +++ b/Src/Asp.Net/SqlSugar/SqlSugar.csproj @@ -122,6 +122,7 @@ + diff --git a/Src/Asp.Net/SqlSugar/SqlSugarClient.cs b/Src/Asp.Net/SqlSugar/SqlSugarClient.cs index 0870f85c4..7078c9a03 100644 --- a/Src/Asp.Net/SqlSugar/SqlSugarClient.cs +++ b/Src/Asp.Net/SqlSugar/SqlSugarClient.cs @@ -15,7 +15,7 @@ namespace SqlSugar /// ** date:2017/1/2 /// ** email:610262374@qq.com /// - public partial class SqlSugarClient : IDisposable + public partial class SqlSugarClient : IDisposable, ISqlSugarClient { #region Constructor