Browse Source

Update core

pull/12/MERGE
skx 5 years ago
parent
commit
cfcfbd7fd1
  1. 16
      Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Abstract/AdoProvider/AdoProvider.cs

16
Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Abstract/AdoProvider/AdoProvider.cs

@ -311,8 +311,7 @@ namespace SqlSugar
sqlCommand.Parameters.Clear(); sqlCommand.Parameters.Clear();
ExecuteAfter(sql, parameters); ExecuteAfter(sql, parameters);
SetConnectionEnd(sql); SetConnectionEnd(sql);
if (this.Context.CurrentConnectionConfig.DbType == DbType.Sqlite) //sqlCommand.Dispose();
sqlCommand.Dispose();
return sqlDataReader; return sqlDataReader;
} }
catch (Exception ex) catch (Exception ex)
@ -446,8 +445,7 @@ namespace SqlSugar
sqlCommand.Parameters.Clear(); sqlCommand.Parameters.Clear();
ExecuteAfter(sql, parameters); ExecuteAfter(sql, parameters);
SetConnectionEnd(sql); SetConnectionEnd(sql);
if (this.Context.CurrentConnectionConfig.DbType == DbType.Sqlite) //sqlCommand.Dispose();
sqlCommand.Dispose();
return sqlDataReader; return sqlDataReader;
} }
catch (Exception ex) catch (Exception ex)
@ -884,7 +882,7 @@ namespace SqlSugar
} }
public async Task<Tuple<List<T>, List<T2>, List<T3>, List<T4>, List<T5>, List<T6>>> SqlQueryAsync<T, T2, T3, T4, T5, T6>(string sql, object parameters = null) public async Task<Tuple<List<T>, List<T2>, List<T3>, List<T4>, List<T5>, List<T6>>> SqlQueryAsync<T, T2, T3, T4, T5, T6>(string sql, object parameters = null)
{ {
var result =await SqlQueryAsync<T, T2, T3, T4, T5, T6, object>(sql, parameters); var result = await SqlQueryAsync<T, T2, T3, T4, T5, T6, object>(sql, parameters);
return new Tuple<List<T>, List<T2>, List<T3>, List<T4>, List<T5>, List<T6>>(result.Item1, result.Item2, result.Item3, result.Item4, result.Item5, result.Item6); return new Tuple<List<T>, List<T2>, List<T3>, List<T4>, List<T5>, List<T6>>(result.Item1, result.Item2, result.Item3, result.Item4, result.Item5, result.Item6);
} }
public async Task<Tuple<List<T>, List<T2>, List<T3>, List<T4>, List<T5>, List<T6>, List<T7>>> SqlQueryAsync<T, T2, T3, T4, T5, T6, T7>(string sql, object parameters = null) public async Task<Tuple<List<T>, List<T2>, List<T3>, List<T4>, List<T5>, List<T6>, List<T7>>> SqlQueryAsync<T, T2, T3, T4, T5, T6, T7>(string sql, object parameters = null)
@ -901,7 +899,7 @@ namespace SqlSugar
List<T> result = new List<T>(); List<T> result = new List<T>();
if (DbReader.HasRows) if (DbReader.HasRows)
{ {
result =await GetDataAsync<T>(typeof(T), dataReader); result = await GetDataAsync<T>(typeof(T), dataReader);
} }
List<T2> result2 = null; List<T2> result2 = null;
if (NextResult(dataReader)) if (NextResult(dataReader))
@ -1391,7 +1389,7 @@ namespace SqlSugar
List<TResult> result; List<TResult> result;
if (entityType == UtilConstants.DynamicType) if (entityType == UtilConstants.DynamicType)
{ {
result =await this.Context.Utilities.DataReaderToExpandoObjectListAsyncNoUsing(dataReader) as List<TResult>; result = await this.Context.Utilities.DataReaderToExpandoObjectListAsyncNoUsing(dataReader) as List<TResult>;
} }
else if (entityType == UtilConstants.ObjType) else if (entityType == UtilConstants.ObjType)
{ {
@ -1400,11 +1398,11 @@ namespace SqlSugar
} }
else if (entityType.IsAnonymousType()) else if (entityType.IsAnonymousType())
{ {
result =await this.Context.Utilities.DataReaderToListAsyncNoUsing<TResult>(dataReader); result = await this.Context.Utilities.DataReaderToListAsyncNoUsing<TResult>(dataReader);
} }
else else
{ {
result =await this.Context.Ado.DbBind.DataReaderToListNoUsingAsync<TResult>(entityType, dataReader); result = await this.Context.Ado.DbBind.DataReaderToListNoUsingAsync<TResult>(entityType, dataReader);
} }
return result; return result;
} }

Loading…
Cancel
Save