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

View File

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

View File

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

View File

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

View File

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

View File

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