Browse Source

Beautification code

pull/12/MERGE
sunkaixuan 6 years ago
parent
commit
0d2368eb67
  1. 38
      Src/Asp.Net/SqlSugar/SqlSugarClient.cs

38
Src/Asp.Net/SqlSugar/SqlSugarClient.cs

@ -24,7 +24,7 @@ namespace SqlSugar
#endregion
#region Api
public ISqlSugarClient Context { get => GetContext(); set => _Context = value; }
public SqlSugarClient(ConnectionConfig config)
{
@ -149,10 +149,6 @@ namespace SqlSugar
return this.Context.Deleteable<T>(deleteObj);
}
public void Dispose()
{
this.Context.Dispose();
}
public DateTime GetDate()
{
@ -178,6 +174,7 @@ namespace SqlSugar
this.Context.InitMppingInfo(typeof(T));
}
#region Insertable
public IInsertable<T> Insertable<T>(Dictionary<string, object> columnDictionary) where T : class, new()
{
return this.Context.Insertable<T>(columnDictionary);
@ -203,11 +200,17 @@ namespace SqlSugar
return this.Context.Insertable<T>(insertObjs);
}
#endregion
public void Open()
{
this.Context.Open();
}
#region Queryable
public ISugarQueryable<T> SqlQueryable<T>(string sql) where T : class, new()
{
return this.Context.SqlQueryable<T>(sql);
}
public ISugarQueryable<ExpandoObject> Queryable(string tableName, string shortName)
{
return this.Context.Queryable(tableName, shortName);
@ -407,6 +410,9 @@ namespace SqlSugar
return this.Context.Queryable<T>(shortName);
}
#endregion
#region Saveable
public ISaveable<T> Saveable<T>(List<T> saveObjects) where T : class, new()
{
return this.Context.Saveable<T>(saveObjects);
@ -416,7 +422,9 @@ namespace SqlSugar
{
return this.Context.Saveable(saveObject);
}
#endregion
#region Queue
public int SaveQueues(bool isTran = true)
{
return this.Context.SaveQueues(isTran);
@ -496,12 +504,9 @@ namespace SqlSugar
{
return this.Context.SaveQueuesAsync<T>(isTran);
}
#endregion
public ISugarQueryable<T> SqlQueryable<T>(string sql) where T : class, new()
{
return this.Context.SqlQueryable<T>(sql);
}
#region Union
public ISugarQueryable<T> Union<T>(List<ISugarQueryable<T>> queryables) where T : class, new()
{
return this.Context.Union(queryables);
@ -521,7 +526,9 @@ namespace SqlSugar
{
return this.Context.UnionAll(queryables);
}
#endregion
#region Updateable
public IUpdateable<T> Updateable<T>() where T : class, new()
{
return this.Context.Updateable<T>();
@ -562,6 +569,9 @@ namespace SqlSugar
return this.Context.Updateable<T>(UpdateObjs);
}
#endregion
#region ITenant
public void BeginAllTran()
{
_IsAllTran = true;
@ -592,6 +602,14 @@ namespace SqlSugar
}
#endregion
#region IDispose
public void Dispose()
{
this.Context.Dispose();
}
#endregion
#region Helper
private ISqlSugarClient GetContext()
{

Loading…
Cancel
Save