Code optimization

This commit is contained in:
sunkaixuan
2019-05-11 14:30:54 +08:00
parent 4062919c02
commit b4a0a9b33c
6 changed files with 48 additions and 48 deletions

View File

@@ -920,14 +920,14 @@ namespace SqlSugar
#endregion #endregion
#region Helper #region Helper
private void TaskStart<Type>(Task<Type> result) //private void TaskStart<Type>(Task<Type> result)
{ //{
if (this.Context.CurrentConnectionConfig.IsShardSameThread) // if (this.Context.CurrentConnectionConfig.IsShardSameThread)
{ // {
Check.Exception(true, "IsShardSameThread=true can't be used async method"); // Check.Exception(true, "IsShardSameThread=true can't be used async method");
} // }
result.Start(); // result.Start();
} //}
private void ExecuteProcessingSQL(ref string sql, SugarParameter[] parameters) private void ExecuteProcessingSQL(ref string sql, SugarParameter[] parameters)
{ {
var result = this.ProcessingEventStartingSQL(sql, parameters); var result = this.ProcessingEventStartingSQL(sql, parameters);

View File

@@ -346,14 +346,14 @@ namespace SqlSugar
} }
} }
private void TaskStart<Type>(Task<Type> result) //private void TaskStart<Type>(Task<Type> result)
{ //{
if (this.Context.CurrentConnectionConfig.IsShardSameThread) // if (this.Context.CurrentConnectionConfig.IsShardSameThread)
{ // {
Check.Exception(true, "IsShardSameThread=true can't be used async method"); // Check.Exception(true, "IsShardSameThread=true can't be used async method");
} // }
result.Start(); // result.Start();
} //}
private void AutoRemoveDataCache() private void AutoRemoveDataCache()
{ {

View File

@@ -399,14 +399,14 @@ namespace SqlSugar
return this.EntityInfo.Columns.Where(it => it.IsIdentity).Select(it => it.DbColumnName).ToList(); return this.EntityInfo.Columns.Where(it => it.IsIdentity).Select(it => it.DbColumnName).ToList();
} }
} }
private void TaskStart<Type>(Task<Type> result) //private void TaskStart<Type>(Task<Type> result)
{ //{
if (this.Context.CurrentConnectionConfig.IsShardSameThread) // if (this.Context.CurrentConnectionConfig.IsShardSameThread)
{ // {
Check.Exception(true, "IsShardSameThread=true can't be used async method"); // Check.Exception(true, "IsShardSameThread=true can't be used async method");
} // }
result.Start(); // result.Start();
} //}
protected void RestoreMapping() protected void RestoreMapping()
{ {
if (IsAs) if (IsAs)

View File

@@ -957,14 +957,14 @@ namespace SqlSugar
#endregion #endregion
#region Private Methods #region Private Methods
private void TaskStart<Type>(Task<Type> result) //private void TaskStart<Type>(Task<Type> result)
{ //{
if (this.Context.CurrentConnectionConfig.IsShardSameThread) // if (this.Context.CurrentConnectionConfig.IsShardSameThread)
{ // {
Check.Exception(true, "IsShardSameThread=true can't be used async method"); // Check.Exception(true, "IsShardSameThread=true can't be used async method");
} // }
result.Start(); // result.Start();
} //}
protected ISugarQueryable<TResult> _Select<TResult>(Expression expression) protected ISugarQueryable<TResult> _Select<TResult>(Expression expression)
{ {
QueryBuilder.CheckExpression(expression, "Select"); QueryBuilder.CheckExpression(expression, "Select");

View File

@@ -583,14 +583,14 @@ namespace SqlSugar
this.Context.MappingTables = OldMappingTableList; this.Context.MappingTables = OldMappingTableList;
} }
} }
private void TaskStart<Type>(Task<Type> result) //private void TaskStart<Type>(Task<Type> result)
{ //{
if (this.Context.CurrentConnectionConfig.IsShardSameThread) // if (this.Context.CurrentConnectionConfig.IsShardSameThread)
{ // {
Check.Exception(true, "IsShardSameThread=true can't be used async method"); // Check.Exception(true, "IsShardSameThread=true can't be used async method");
} // }
result.Start(); // result.Start();
} //}
//private IUpdateable<T> CopyUpdateable() //private IUpdateable<T> CopyUpdateable()
//{ //{
// var asyncContext = this.Context.Utilities.CopyContext(true); // var asyncContext = this.Context.Utilities.CopyContext(true);

View File

@@ -794,14 +794,14 @@ namespace SqlSugar
_Context = Tenant.Context; _Context = Tenant.Context;
this.CurrentConnectionConfig = Tenant.ConnectionConfig; this.CurrentConnectionConfig = Tenant.ConnectionConfig;
} }
private void TaskStart<Type>(Task<Type> result) //private void TaskStart<Type>(Task<Type> result)
{ //{
if (this.Context.CurrentConnectionConfig.IsShardSameThread) // if (this.Context.CurrentConnectionConfig.IsShardSameThread)
{ // {
Check.Exception(true, "IsShardSameThread=true can't be used async method"); // Check.Exception(true, "IsShardSameThread=true can't be used async method");
} // }
result.Start(); // result.Start();
} //}
#endregion #endregion
#region Obsolete #region Obsolete