mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-23 22:11:36 +08:00
Add Queue
This commit is contained in:
parent
304ecc64ed
commit
cca8a34ff7
65
Src/Asp.Net/SqlServerTest/Demos/H_Queue.cs
Normal file
65
Src/Asp.Net/SqlServerTest/Demos/H_Queue.cs
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
using OrmTest.Demo;
|
||||||
|
using OrmTest.Models;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace OrmTest.Demo
|
||||||
|
{
|
||||||
|
public class Queue : DemoBase
|
||||||
|
{
|
||||||
|
public static void Init()
|
||||||
|
{
|
||||||
|
var db = GetInstance();
|
||||||
|
db.Insertable<Student>(new Student() { Name = "a" }).AddQueue();
|
||||||
|
db.Insertable<Student>(new Student() { Name = "b" }).AddQueue();
|
||||||
|
db.SaveQueues();
|
||||||
|
|
||||||
|
db.Insertable<Student>(new Student() { Name = "a" }).AddQueue();
|
||||||
|
db.Insertable<Student>(new Student() { Name = "b" }).AddQueue();
|
||||||
|
db.Insertable<Student>(new Student() { Name = "c" }).AddQueue();
|
||||||
|
db.Insertable<Student>(new Student() { Name = "d" }).AddQueue();
|
||||||
|
var ar = db.SaveQueuesAsync();
|
||||||
|
ar.Wait();
|
||||||
|
|
||||||
|
|
||||||
|
db.Queryable<Student>().AddQueue();
|
||||||
|
db.Queryable<School>().AddQueue();
|
||||||
|
var result = db.SaveQueues<Student, School>();
|
||||||
|
|
||||||
|
db.Queryable<Student>().AddQueue();
|
||||||
|
db.Queryable<School>().AddQueue();
|
||||||
|
db.AddQueue("select @id", new { id = 1 });
|
||||||
|
var result2 = db.SaveQueues<Student, School, int>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
db.AddQueue("select 1");
|
||||||
|
db.AddQueue("select 2");
|
||||||
|
db.AddQueue("select 3");
|
||||||
|
db.AddQueue("select 4");
|
||||||
|
db.AddQueue("select 5");
|
||||||
|
db.AddQueue("select 6");
|
||||||
|
db.AddQueue("select 7");
|
||||||
|
|
||||||
|
var result3 = db.SaveQueues<int, int, int, int, int, int, int>();
|
||||||
|
|
||||||
|
|
||||||
|
db.AddQueue("select 1");
|
||||||
|
var result4 = db.SaveQueues<int >();
|
||||||
|
|
||||||
|
|
||||||
|
db.AddQueue("select 1");
|
||||||
|
db.AddQueue("select 2");
|
||||||
|
var result5 = db.SaveQueues<int,int>();
|
||||||
|
|
||||||
|
|
||||||
|
db.AddQueue("select 1");
|
||||||
|
db.AddQueue("select 2");
|
||||||
|
db.AddQueue("select 3");
|
||||||
|
var result6 = db.SaveQueuesAsync<int, int,int>();
|
||||||
|
result6.Wait();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -53,6 +53,7 @@ namespace OrmTest
|
|||||||
Demo.Delete.Init();
|
Demo.Delete.Init();
|
||||||
Demo.InsertOrUpdate.Init();
|
Demo.InsertOrUpdate.Init();
|
||||||
Demo.Debugger.Init();
|
Demo.Debugger.Init();
|
||||||
|
Demo.Queue.Init();
|
||||||
|
|
||||||
Console.WriteLine("all successfully.");
|
Console.WriteLine("all successfully.");
|
||||||
Console.ReadKey();
|
Console.ReadKey();
|
||||||
|
@ -58,6 +58,7 @@
|
|||||||
<Compile Include="BugTest\BugModels\tLogonHistoryModel.cs" />
|
<Compile Include="BugTest\BugModels\tLogonHistoryModel.cs" />
|
||||||
<Compile Include="BugTest\BugModels\VipAccountsModel.cs" />
|
<Compile Include="BugTest\BugModels\VipAccountsModel.cs" />
|
||||||
<Compile Include="BugTest\BugModels\VipBenefitsModel.cs" />
|
<Compile Include="BugTest\BugModels\VipBenefitsModel.cs" />
|
||||||
|
<Compile Include="Demos\H_Queue.cs" />
|
||||||
<Compile Include="Demos\I_InsertOrUpdate.cs" />
|
<Compile Include="Demos\I_InsertOrUpdate.cs" />
|
||||||
<Compile Include="Demos\J_Debugger.cs" />
|
<Compile Include="Demos\J_Debugger.cs" />
|
||||||
<Compile Include="Models\Brand.cs" />
|
<Compile Include="Models\Brand.cs" />
|
||||||
|
@ -343,6 +343,35 @@ namespace SqlSugar
|
|||||||
throw ex;
|
throw ex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public virtual IDataReader GetDataReaderNoClose(string sql, params SugarParameter[] parameters)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
InitParameters(ref sql, parameters);
|
||||||
|
if (FormatSql != null)
|
||||||
|
sql = FormatSql(sql);
|
||||||
|
SetConnectionStart(sql);
|
||||||
|
var isSp = this.CommandType == CommandType.StoredProcedure;
|
||||||
|
if (this.ProcessingEventStartingSQL != null)
|
||||||
|
ExecuteProcessingSQL(ref sql, parameters);
|
||||||
|
ExecuteBefore(sql, parameters);
|
||||||
|
IDbCommand sqlCommand = GetCommand(sql, parameters);
|
||||||
|
IDataReader sqlDataReader = sqlCommand.ExecuteReader();
|
||||||
|
if (isSp)
|
||||||
|
DataReaderParameters = sqlCommand.Parameters;
|
||||||
|
if (this.IsClearParameters)
|
||||||
|
sqlCommand.Parameters.Clear();
|
||||||
|
ExecuteAfter(sql, parameters);
|
||||||
|
SetConnectionEnd(sql);
|
||||||
|
return sqlDataReader;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ErrorEvent != null)
|
||||||
|
ExecuteErrorEvent(sql, parameters, ex);
|
||||||
|
throw ex;
|
||||||
|
}
|
||||||
|
}
|
||||||
public virtual DataSet GetDataSetAll(string sql, params SugarParameter[] parameters)
|
public virtual DataSet GetDataSetAll(string sql, params SugarParameter[] parameters)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@ -547,6 +576,226 @@ namespace SqlSugar
|
|||||||
return SqlQuery<T>(sql);
|
return SqlQuery<T>(sql);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public Tuple<List<T>, List<T2>> SqlQuery<T, T2>(string sql, object parameters = null)
|
||||||
|
{
|
||||||
|
var parsmeterArray = this.GetParameters(parameters);
|
||||||
|
this.Context.InitMppingInfo<T>();
|
||||||
|
var builder = InstanceFactory.GetSqlbuilder(this.Context.CurrentConnectionConfig);
|
||||||
|
builder.SqlQueryBuilder.sql.Append(sql);
|
||||||
|
if (parsmeterArray != null && parsmeterArray.Any())
|
||||||
|
builder.SqlQueryBuilder.Parameters.AddRange(parsmeterArray);
|
||||||
|
using (var dataReader = this.GetDataReaderNoClose(builder.SqlQueryBuilder.ToSqlString(), builder.SqlQueryBuilder.Parameters.ToArray()))
|
||||||
|
{
|
||||||
|
List<T> result = this.DbBind.DataReaderToListNoUsing<T>(typeof(T), dataReader);
|
||||||
|
NextResult(dataReader);
|
||||||
|
List<T2> result2 = this.DbBind.DataReaderToListNoUsing<T2>(typeof(T2), dataReader);
|
||||||
|
builder.SqlQueryBuilder.Clear();
|
||||||
|
if (this.Context.Ado.DataReaderParameters != null)
|
||||||
|
{
|
||||||
|
foreach (IDataParameter item in this.Context.Ado.DataReaderParameters)
|
||||||
|
{
|
||||||
|
var parameter = parsmeterArray.FirstOrDefault(it => item.ParameterName.Substring(1) == it.ParameterName.Substring(1));
|
||||||
|
if (parameter != null)
|
||||||
|
{
|
||||||
|
parameter.Value = item.Value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.Context.Ado.DataReaderParameters = null;
|
||||||
|
}
|
||||||
|
return Tuple.Create<List<T>, List<T2>>(result, result2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Tuple<List<T>, List<T2>, List<T3>> SqlQuery<T, T2, T3>(string sql, object parameters = null)
|
||||||
|
{
|
||||||
|
var parsmeterArray = this.GetParameters(parameters);
|
||||||
|
this.Context.InitMppingInfo<T>();
|
||||||
|
var builder = InstanceFactory.GetSqlbuilder(this.Context.CurrentConnectionConfig);
|
||||||
|
builder.SqlQueryBuilder.sql.Append(sql);
|
||||||
|
if (parsmeterArray != null && parsmeterArray.Any())
|
||||||
|
builder.SqlQueryBuilder.Parameters.AddRange(parsmeterArray);
|
||||||
|
using (var dataReader = this.GetDataReaderNoClose(builder.SqlQueryBuilder.ToSqlString(), builder.SqlQueryBuilder.Parameters.ToArray()))
|
||||||
|
{
|
||||||
|
List<T> result = this.DbBind.DataReaderToListNoUsing<T>(typeof(T), dataReader);
|
||||||
|
NextResult(dataReader);
|
||||||
|
List<T2> result2 = this.DbBind.DataReaderToListNoUsing<T2>(typeof(T2), dataReader);
|
||||||
|
NextResult(dataReader);
|
||||||
|
List<T3> result3 = this.DbBind.DataReaderToListNoUsing<T3>(typeof(T3), dataReader);
|
||||||
|
builder.SqlQueryBuilder.Clear();
|
||||||
|
if (this.Context.Ado.DataReaderParameters != null)
|
||||||
|
{
|
||||||
|
foreach (IDataParameter item in this.Context.Ado.DataReaderParameters)
|
||||||
|
{
|
||||||
|
var parameter = parsmeterArray.FirstOrDefault(it => item.ParameterName.Substring(1) == it.ParameterName.Substring(1));
|
||||||
|
if (parameter != null)
|
||||||
|
{
|
||||||
|
parameter.Value = item.Value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.Context.Ado.DataReaderParameters = null;
|
||||||
|
}
|
||||||
|
return Tuple.Create<List<T>, List<T2>, List<T3>>(result, result2, result3);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Tuple<List<T>, List<T2>, List<T3>, List<T4>> SqlQuery<T, T2, T3, T4>(string sql, object parameters = null)
|
||||||
|
{
|
||||||
|
var parsmeterArray = this.GetParameters(parameters);
|
||||||
|
this.Context.InitMppingInfo<T>();
|
||||||
|
var builder = InstanceFactory.GetSqlbuilder(this.Context.CurrentConnectionConfig);
|
||||||
|
builder.SqlQueryBuilder.sql.Append(sql);
|
||||||
|
if (parsmeterArray != null && parsmeterArray.Any())
|
||||||
|
builder.SqlQueryBuilder.Parameters.AddRange(parsmeterArray);
|
||||||
|
using (var dataReader = this.GetDataReaderNoClose(builder.SqlQueryBuilder.ToSqlString(), builder.SqlQueryBuilder.Parameters.ToArray()))
|
||||||
|
{
|
||||||
|
List<T> result = this.DbBind.DataReaderToListNoUsing<T>(typeof(T), dataReader);
|
||||||
|
NextResult(dataReader);
|
||||||
|
List<T2> result2 = this.DbBind.DataReaderToListNoUsing<T2>(typeof(T2), dataReader);
|
||||||
|
NextResult(dataReader);
|
||||||
|
List<T3> result3 = this.DbBind.DataReaderToListNoUsing<T3>(typeof(T3), dataReader);
|
||||||
|
NextResult(dataReader);
|
||||||
|
List<T4> result4 = this.DbBind.DataReaderToListNoUsing<T4>(typeof(T4), dataReader);
|
||||||
|
builder.SqlQueryBuilder.Clear();
|
||||||
|
if (this.Context.Ado.DataReaderParameters != null)
|
||||||
|
{
|
||||||
|
foreach (IDataParameter item in this.Context.Ado.DataReaderParameters)
|
||||||
|
{
|
||||||
|
var parameter = parsmeterArray.FirstOrDefault(it => item.ParameterName.Substring(1) == it.ParameterName.Substring(1));
|
||||||
|
if (parameter != null)
|
||||||
|
{
|
||||||
|
parameter.Value = item.Value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.Context.Ado.DataReaderParameters = null;
|
||||||
|
}
|
||||||
|
return Tuple.Create<List<T>, List<T2>, List<T3>, List<T4>>(result, result2, result3, result4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public Tuple<List<T>, List<T2>, List<T3>, List<T4>, List<T5>> SqlQuery<T, T2, T3, T4, T5>(string sql, object parameters = null)
|
||||||
|
{
|
||||||
|
var parsmeterArray = this.GetParameters(parameters);
|
||||||
|
this.Context.InitMppingInfo<T>();
|
||||||
|
var builder = InstanceFactory.GetSqlbuilder(this.Context.CurrentConnectionConfig);
|
||||||
|
builder.SqlQueryBuilder.sql.Append(sql);
|
||||||
|
if (parsmeterArray != null && parsmeterArray.Any())
|
||||||
|
builder.SqlQueryBuilder.Parameters.AddRange(parsmeterArray);
|
||||||
|
using (var dataReader = this.GetDataReaderNoClose(builder.SqlQueryBuilder.ToSqlString(), builder.SqlQueryBuilder.Parameters.ToArray()))
|
||||||
|
{
|
||||||
|
List<T> result = this.DbBind.DataReaderToListNoUsing<T>(typeof(T), dataReader);
|
||||||
|
NextResult(dataReader);
|
||||||
|
List<T2> result2 = this.DbBind.DataReaderToListNoUsing<T2>(typeof(T2), dataReader);
|
||||||
|
NextResult(dataReader);
|
||||||
|
List<T3> result3 = this.DbBind.DataReaderToListNoUsing<T3>(typeof(T3), dataReader);
|
||||||
|
NextResult(dataReader);
|
||||||
|
List<T4> result4 = this.DbBind.DataReaderToListNoUsing<T4>(typeof(T4), dataReader);
|
||||||
|
NextResult(dataReader);
|
||||||
|
List<T5> result5 = this.DbBind.DataReaderToListNoUsing<T5>(typeof(T5), dataReader);
|
||||||
|
builder.SqlQueryBuilder.Clear();
|
||||||
|
if (this.Context.Ado.DataReaderParameters != null)
|
||||||
|
{
|
||||||
|
foreach (IDataParameter item in this.Context.Ado.DataReaderParameters)
|
||||||
|
{
|
||||||
|
var parameter = parsmeterArray.FirstOrDefault(it => item.ParameterName.Substring(1) == it.ParameterName.Substring(1));
|
||||||
|
if (parameter != null)
|
||||||
|
{
|
||||||
|
parameter.Value = item.Value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.Context.Ado.DataReaderParameters = null;
|
||||||
|
}
|
||||||
|
return Tuple.Create<List<T>, List<T2>, List<T3>, List<T4>, List<T5>>(result, result2, result3, result4, result5);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Tuple<List<T>, List<T2>, List<T3>, List<T4>, List<T5>, List<T6>> SqlQuery<T, T2, T3, T4, T5, T6>(string sql, object parameters = null)
|
||||||
|
{
|
||||||
|
var parsmeterArray = this.GetParameters(parameters);
|
||||||
|
this.Context.InitMppingInfo<T>();
|
||||||
|
var builder = InstanceFactory.GetSqlbuilder(this.Context.CurrentConnectionConfig);
|
||||||
|
builder.SqlQueryBuilder.sql.Append(sql);
|
||||||
|
if (parsmeterArray != null && parsmeterArray.Any())
|
||||||
|
builder.SqlQueryBuilder.Parameters.AddRange(parsmeterArray);
|
||||||
|
using (var dataReader = this.GetDataReaderNoClose(builder.SqlQueryBuilder.ToSqlString(), builder.SqlQueryBuilder.Parameters.ToArray()))
|
||||||
|
{
|
||||||
|
List<T> result = this.DbBind.DataReaderToListNoUsing<T>(typeof(T), dataReader);
|
||||||
|
NextResult(dataReader);
|
||||||
|
List<T2> result2 = this.DbBind.DataReaderToListNoUsing<T2>(typeof(T2), dataReader);
|
||||||
|
NextResult(dataReader);
|
||||||
|
List<T3> result3 = this.DbBind.DataReaderToListNoUsing<T3>(typeof(T3), dataReader);
|
||||||
|
NextResult(dataReader);
|
||||||
|
List<T4> result4 = this.DbBind.DataReaderToListNoUsing<T4>(typeof(T4), dataReader);
|
||||||
|
NextResult(dataReader);
|
||||||
|
List<T5> result5 = this.DbBind.DataReaderToListNoUsing<T5>(typeof(T5), dataReader);
|
||||||
|
NextResult(dataReader);
|
||||||
|
List<T6> result6 = this.DbBind.DataReaderToListNoUsing<T6>(typeof(T6), dataReader);
|
||||||
|
builder.SqlQueryBuilder.Clear();
|
||||||
|
if (this.Context.Ado.DataReaderParameters != null)
|
||||||
|
{
|
||||||
|
foreach (IDataParameter item in this.Context.Ado.DataReaderParameters)
|
||||||
|
{
|
||||||
|
var parameter = parsmeterArray.FirstOrDefault(it => item.ParameterName.Substring(1) == it.ParameterName.Substring(1));
|
||||||
|
if (parameter != null)
|
||||||
|
{
|
||||||
|
parameter.Value = item.Value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.Context.Ado.DataReaderParameters = null;
|
||||||
|
}
|
||||||
|
return Tuple.Create<List<T>, List<T2>, List<T3>, List<T4>, List<T5>, List<T6>>(result, result2, result3, result4, result5, result6);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Tuple<List<T>, List<T2>, List<T3>, List<T4>, List<T5>, List<T6>, List<T7>> SqlQuery<T, T2, T3, T4, T5, T6, T7>(string sql, object parameters = null)
|
||||||
|
{
|
||||||
|
var parsmeterArray = this.GetParameters(parameters);
|
||||||
|
this.Context.InitMppingInfo<T>();
|
||||||
|
var builder = InstanceFactory.GetSqlbuilder(this.Context.CurrentConnectionConfig);
|
||||||
|
builder.SqlQueryBuilder.sql.Append(sql);
|
||||||
|
if (parsmeterArray != null && parsmeterArray.Any())
|
||||||
|
builder.SqlQueryBuilder.Parameters.AddRange(parsmeterArray);
|
||||||
|
using (var dataReader = this.GetDataReaderNoClose(builder.SqlQueryBuilder.ToSqlString(), builder.SqlQueryBuilder.Parameters.ToArray()))
|
||||||
|
{
|
||||||
|
List<T> result = this.DbBind.DataReaderToListNoUsing<T>(typeof(T), dataReader);
|
||||||
|
NextResult(dataReader);
|
||||||
|
List<T2> result2 = this.DbBind.DataReaderToListNoUsing<T2>(typeof(T2), dataReader);
|
||||||
|
NextResult(dataReader);
|
||||||
|
List<T3> result3 = this.DbBind.DataReaderToListNoUsing<T3>(typeof(T3), dataReader);
|
||||||
|
NextResult(dataReader);
|
||||||
|
List<T4> result4 = this.DbBind.DataReaderToListNoUsing<T4>(typeof(T4), dataReader);
|
||||||
|
NextResult(dataReader);
|
||||||
|
List<T5> result5 = this.DbBind.DataReaderToListNoUsing<T5>(typeof(T5), dataReader);
|
||||||
|
NextResult(dataReader);
|
||||||
|
List<T6> result6 = this.DbBind.DataReaderToListNoUsing<T6>(typeof(T6), dataReader);
|
||||||
|
NextResult(dataReader);
|
||||||
|
List<T7> result7 = this.DbBind.DataReaderToListNoUsing<T7>(typeof(T7), dataReader);
|
||||||
|
builder.SqlQueryBuilder.Clear();
|
||||||
|
if (this.Context.Ado.DataReaderParameters != null)
|
||||||
|
{
|
||||||
|
foreach (IDataParameter item in this.Context.Ado.DataReaderParameters)
|
||||||
|
{
|
||||||
|
var parameter = parsmeterArray.FirstOrDefault(it => item.ParameterName.Substring(1) == it.ParameterName.Substring(1));
|
||||||
|
if (parameter != null)
|
||||||
|
{
|
||||||
|
parameter.Value = item.Value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.Context.Ado.DataReaderParameters = null;
|
||||||
|
}
|
||||||
|
return Tuple.Create<List<T>, List<T2>, List<T3>, List<T4>, List<T5>, List<T6>, List<T7>>(result, result2, result3, result4, result5, result6, result7);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void NextResult(IDataReader dataReader)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
dataReader.NextResult();
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
Check.Exception(true, ErrorMessage.GetThrowMessage("Please reduce the number of T. Save Queue Changes queries don't have so many results", "请减少T的数量,SaveQueueChanges 查询没有这么多结果"));
|
||||||
|
}
|
||||||
|
}
|
||||||
public virtual T SqlQuerySingle<T>(string sql, object parameters = null)
|
public virtual T SqlQuerySingle<T>(string sql, object parameters = null)
|
||||||
{
|
{
|
||||||
var result = SqlQuery<T>(sql, parameters);
|
var result = SqlQuery<T>(sql, parameters);
|
||||||
|
@ -187,7 +187,7 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
return GetKeyValueList<T>(type, dataReader);
|
return GetKeyValueList<T>(type, dataReader);
|
||||||
}
|
}
|
||||||
else if (type.IsValueType() || type == UtilConstants.StringType||type== UtilConstants.ByteArrayType)
|
else if (type.IsValueType() || type == UtilConstants.StringType || type == UtilConstants.ByteArrayType)
|
||||||
{
|
{
|
||||||
return GetValueTypeList<T>(type, dataReader);
|
return GetValueTypeList<T>(type, dataReader);
|
||||||
}
|
}
|
||||||
@ -201,6 +201,25 @@ namespace SqlSugar
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public virtual List<T> DataReaderToListNoUsing<T>(Type type, IDataReader dataReader)
|
||||||
|
{
|
||||||
|
if (type.Name.Contains("KeyValuePair"))
|
||||||
|
{
|
||||||
|
return GetKeyValueList<T>(type, dataReader);
|
||||||
|
}
|
||||||
|
else if (type.IsValueType() || type == UtilConstants.StringType || type == UtilConstants.ByteArrayType)
|
||||||
|
{
|
||||||
|
return GetValueTypeList<T>(type, dataReader);
|
||||||
|
}
|
||||||
|
else if (type.IsArray)
|
||||||
|
{
|
||||||
|
return GetArrayList<T>(type, dataReader);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return GetEntityList<T>(Context, dataReader);
|
||||||
|
}
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Throw rule
|
#region Throw rule
|
||||||
|
@ -41,7 +41,11 @@ namespace SqlSugar
|
|||||||
After(sql);
|
After(sql);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
public void AddQueue()
|
||||||
|
{
|
||||||
|
var sqlObj = this.ToSql();
|
||||||
|
this.Context.Queues.Add(sqlObj.Key, sqlObj.Value);
|
||||||
|
}
|
||||||
public bool ExecuteCommandHasChange()
|
public bool ExecuteCommandHasChange()
|
||||||
{
|
{
|
||||||
return ExecuteCommand() > 0;
|
return ExecuteCommand() > 0;
|
||||||
|
@ -33,6 +33,11 @@ namespace SqlSugar
|
|||||||
|
|
||||||
|
|
||||||
#region Core
|
#region Core
|
||||||
|
public void AddQueue()
|
||||||
|
{
|
||||||
|
var sqlObj = this.ToSql();
|
||||||
|
this.Context.Queues.Add(sqlObj.Key, sqlObj.Value);
|
||||||
|
}
|
||||||
public virtual int ExecuteCommand()
|
public virtual int ExecuteCommand()
|
||||||
{
|
{
|
||||||
if (InsertBuilder.DbColumnInfoList.HasValue())
|
if (InsertBuilder.DbColumnInfoList.HasValue())
|
||||||
|
@ -50,7 +50,11 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
QueryBuilder.Clear();
|
QueryBuilder.Clear();
|
||||||
}
|
}
|
||||||
|
public void AddQueue()
|
||||||
|
{
|
||||||
|
var sqlObj = this.ToSql();
|
||||||
|
this.Context.Queues.Add(sqlObj.Key,sqlObj.Value);
|
||||||
|
}
|
||||||
public ISugarQueryable<T> Clone()
|
public ISugarQueryable<T> Clone()
|
||||||
{
|
{
|
||||||
var queryable = this.Context.Queryable<T>().WithCacheIF(IsCache, CacheTime);
|
var queryable = this.Context.Queryable<T>().WithCacheIF(IsCache, CacheTime);
|
||||||
|
@ -32,7 +32,11 @@ namespace SqlSugar
|
|||||||
public bool IsEnableDiffLogEvent { get; set; }
|
public bool IsEnableDiffLogEvent { get; set; }
|
||||||
public DiffLogModel diffModel { get; set; }
|
public DiffLogModel diffModel { get; set; }
|
||||||
private Action RemoveCacheFunc { get; set; }
|
private Action RemoveCacheFunc { get; set; }
|
||||||
|
public void AddQueue()
|
||||||
|
{
|
||||||
|
var sqlObj = this.ToSql();
|
||||||
|
this.Context.Queues.Add(sqlObj.Key, sqlObj.Value);
|
||||||
|
}
|
||||||
public virtual int ExecuteCommand()
|
public virtual int ExecuteCommand()
|
||||||
{
|
{
|
||||||
PreToSql();
|
PreToSql();
|
||||||
|
13
Src/Asp.Net/SqlSugar/Entities/QueueItem.cs
Normal file
13
Src/Asp.Net/SqlSugar/Entities/QueueItem.cs
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace SqlSugar
|
||||||
|
{
|
||||||
|
public class QueueItem
|
||||||
|
{
|
||||||
|
public string Sql { get; set; }
|
||||||
|
public SugarParameter[] Parameters { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@ -19,7 +19,7 @@ namespace SqlSugar
|
|||||||
}
|
}
|
||||||
public new void Clear()
|
public new void Clear()
|
||||||
{
|
{
|
||||||
this.RemoveAll(it=>true);
|
this.RemoveAll(it => true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -27,7 +27,7 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
public void Add(string propertyName, string EntityName)
|
public void Add(string propertyName, string EntityName)
|
||||||
{
|
{
|
||||||
this.RemoveAll(it =>it.EntityName==EntityName&&it.PropertyName.Equals(propertyName, StringComparison.CurrentCultureIgnoreCase));
|
this.RemoveAll(it => it.EntityName == EntityName && it.PropertyName.Equals(propertyName, StringComparison.CurrentCultureIgnoreCase));
|
||||||
this.Add(new IgnoreColumn() { PropertyName = propertyName, EntityName = EntityName });
|
this.Add(new IgnoreColumn() { PropertyName = propertyName, EntityName = EntityName });
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -41,7 +41,7 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
public void Add(string propertyName, string dbColumnName, string entityName)
|
public void Add(string propertyName, string dbColumnName, string entityName)
|
||||||
{
|
{
|
||||||
this.RemoveAll(it =>it.EntityName==entityName &&it.PropertyName.Equals(propertyName, StringComparison.CurrentCultureIgnoreCase));
|
this.RemoveAll(it => it.EntityName == entityName && it.PropertyName.Equals(propertyName, StringComparison.CurrentCultureIgnoreCase));
|
||||||
this.Add(new MappingColumn() { PropertyName = propertyName, DbColumnName = dbColumnName, EntityName = entityName });
|
this.Add(new MappingColumn() { PropertyName = propertyName, DbColumnName = dbColumnName, EntityName = entityName });
|
||||||
}
|
}
|
||||||
public new void Clear()
|
public new void Clear()
|
||||||
@ -49,4 +49,23 @@ namespace SqlSugar
|
|||||||
this.RemoveAll(it => true);
|
this.RemoveAll(it => true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class QueueList : List<QueueItem>
|
||||||
|
{
|
||||||
|
public void Add(string sql, SugarParameter[] parameters)
|
||||||
|
{
|
||||||
|
this.Add(new QueueItem() { Sql = sql, Parameters = parameters });
|
||||||
|
}
|
||||||
|
public void Add(string sql, List<SugarParameter> parameters)
|
||||||
|
{
|
||||||
|
if (parameters == null)
|
||||||
|
parameters = new List<SugarParameter>();
|
||||||
|
this.Add(new QueueItem() { Sql = sql, Parameters = parameters.ToArray() });
|
||||||
|
}
|
||||||
|
public new void Clear()
|
||||||
|
{
|
||||||
|
this.RemoveAll(it => true);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -67,6 +67,13 @@ namespace SqlSugar
|
|||||||
DateTime GetDateTime(string sql, params SugarParameter[] parameters);
|
DateTime GetDateTime(string sql, params SugarParameter[] parameters);
|
||||||
DateTime GetDateTime(string sql, List<SugarParameter> parameters);
|
DateTime GetDateTime(string sql, List<SugarParameter> parameters);
|
||||||
List<T> SqlQuery<T>(string sql, object parameters = null);
|
List<T> SqlQuery<T>(string sql, object parameters = null);
|
||||||
|
Tuple<List<T>, List<T2>> SqlQuery<T,T2>(string sql, object parameters = null);
|
||||||
|
Tuple<List<T>, List<T2>, List<T3>> SqlQuery<T, T2,T3>(string sql, object parameters = null);
|
||||||
|
Tuple<List<T>, List<T2>, List<T3>,List<T4>> SqlQuery<T,T2,T3,T4>(string sql, object parameters = null);
|
||||||
|
Tuple<List<T>, List<T2>, List<T3>, List<T4>, List<T5>> SqlQuery<T, T2, T3, T4,T5>(string sql, object parameters = null);
|
||||||
|
Tuple<List<T>, List<T2>, List<T3>, List<T4>, List<T5>, List<T6>> SqlQuery<T, T2, T3, T4, T5,T6>(string sql, object parameters = null);
|
||||||
|
Tuple<List<T>, List<T2>, List<T3>, List<T4>, List<T5>, List<T6>, List<T7>> SqlQuery<T, T2, T3, T4, T5, T6,T7>(string sql, object parameters = null);
|
||||||
|
|
||||||
List<T> SqlQuery<T>(string sql, params SugarParameter[] parameters);
|
List<T> SqlQuery<T>(string sql, params SugarParameter[] parameters);
|
||||||
List<T> SqlQuery<T>(string sql, List<SugarParameter> parameters);
|
List<T> SqlQuery<T>(string sql, List<SugarParameter> parameters);
|
||||||
T SqlQuerySingle<T>(string sql, object whereObj = null);
|
T SqlQuerySingle<T>(string sql, object whereObj = null);
|
||||||
|
@ -21,5 +21,6 @@ namespace SqlSugar
|
|||||||
string GetCsharpTypeName(string dbTypeName);
|
string GetCsharpTypeName(string dbTypeName);
|
||||||
List<KeyValuePair<string, CSharpDataType>> MappingTypes { get; }
|
List<KeyValuePair<string, CSharpDataType>> MappingTypes { get; }
|
||||||
List<T> DataReaderToList<T>(Type type, IDataReader reader);
|
List<T> DataReaderToList<T>(Type type, IDataReader reader);
|
||||||
|
List<T> DataReaderToListNoUsing<T>(Type type, IDataReader reader);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -32,5 +32,6 @@ namespace SqlSugar
|
|||||||
IDeleteable<T> EnableDiffLogEvent(object businessData = null);
|
IDeleteable<T> EnableDiffLogEvent(object businessData = null);
|
||||||
IDeleteable<T> RemoveDataCache();
|
IDeleteable<T> RemoveDataCache();
|
||||||
KeyValuePair<string, List<SugarParameter>> ToSql();
|
KeyValuePair<string, List<SugarParameter>> ToSql();
|
||||||
|
void AddQueue();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -145,6 +145,7 @@ namespace SqlSugar
|
|||||||
ISugarQueryable<T> WithCacheIF(bool isCache, int cacheDurationInSeconds = int.MaxValue);
|
ISugarQueryable<T> WithCacheIF(bool isCache, int cacheDurationInSeconds = int.MaxValue);
|
||||||
string ToClassString(string className);
|
string ToClassString(string className);
|
||||||
void Clear();
|
void Clear();
|
||||||
|
void AddQueue();
|
||||||
}
|
}
|
||||||
public partial interface ISugarQueryable<T, T2> : ISugarQueryable<T>
|
public partial interface ISugarQueryable<T, T2> : ISugarQueryable<T>
|
||||||
{
|
{
|
||||||
|
@ -55,5 +55,6 @@ namespace SqlSugar
|
|||||||
IUpdateable<T> ReSetValue(Expression<Func<T, bool>> setValueExpression);
|
IUpdateable<T> ReSetValue(Expression<Func<T, bool>> setValueExpression);
|
||||||
IUpdateable<T> RemoveDataCache();
|
IUpdateable<T> RemoveDataCache();
|
||||||
KeyValuePair<string,List<SugarParameter>> ToSql();
|
KeyValuePair<string,List<SugarParameter>> ToSql();
|
||||||
|
void AddQueue();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,5 +31,6 @@ namespace SqlSugar
|
|||||||
IInsertable<T> EnableDiffLogEvent(object businessData = null);
|
IInsertable<T> EnableDiffLogEvent(object businessData = null);
|
||||||
IInsertable<T> RemoveDataCache();
|
IInsertable<T> RemoveDataCache();
|
||||||
KeyValuePair<string, List<SugarParameter>> ToSql();
|
KeyValuePair<string, List<SugarParameter>> ToSql();
|
||||||
|
void AddQueue();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -82,6 +82,7 @@
|
|||||||
<Compile Include="Entities\DiffLogModel.cs" />
|
<Compile Include="Entities\DiffLogModel.cs" />
|
||||||
<Compile Include="Entities\DiffType.cs" />
|
<Compile Include="Entities\DiffType.cs" />
|
||||||
<Compile Include="Entities\MapperCache.cs" />
|
<Compile Include="Entities\MapperCache.cs" />
|
||||||
|
<Compile Include="Entities\QueueItem.cs" />
|
||||||
<Compile Include="Entities\SlaveConnectionConfig.cs" />
|
<Compile Include="Entities\SlaveConnectionConfig.cs" />
|
||||||
<Compile Include="Entities\SugarDebugger.cs" />
|
<Compile Include="Entities\SugarDebugger.cs" />
|
||||||
<Compile Include="Enum\ConditionalType.cs" />
|
<Compile Include="Enum\ConditionalType.cs" />
|
||||||
|
@ -97,14 +97,15 @@ namespace SqlSugar
|
|||||||
/// Get datebase time
|
/// Get datebase time
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public DateTime GetDate() {
|
public DateTime GetDate()
|
||||||
|
{
|
||||||
var sqlBuilder = InstanceFactory.GetSqlbuilder(this.Context.CurrentConnectionConfig);
|
var sqlBuilder = InstanceFactory.GetSqlbuilder(this.Context.CurrentConnectionConfig);
|
||||||
return this.Ado.GetDateTime(sqlBuilder.FullSqlDateNow);
|
return this.Ado.GetDateTime(sqlBuilder.FullSqlDateNow);
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Lambda Query operation
|
/// Lambda Query operation
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public virtual ISugarQueryable<T> Queryable<T>()
|
public virtual ISugarQueryable<T> Queryable<T>()
|
||||||
{
|
{
|
||||||
|
|
||||||
InitMppingInfo<T>();
|
InitMppingInfo<T>();
|
||||||
@ -130,7 +131,7 @@ namespace SqlSugar
|
|||||||
queryable.SqlBuilder.QueryBuilder.TableShortName = shortName;
|
queryable.SqlBuilder.QueryBuilder.TableShortName = shortName;
|
||||||
return queryable;
|
return queryable;
|
||||||
}
|
}
|
||||||
public virtual ISugarQueryable<T, T2> Queryable<T, T2>(Expression<Func<T, T2, object[]>> joinExpression)
|
public virtual ISugarQueryable<T, T2> Queryable<T, T2>(Expression<Func<T, T2, object[]>> joinExpression)
|
||||||
{
|
{
|
||||||
InitMppingInfo<T, T2>();
|
InitMppingInfo<T, T2>();
|
||||||
var types = new Type[] { typeof(T2) };
|
var types = new Type[] { typeof(T2) };
|
||||||
@ -138,7 +139,7 @@ namespace SqlSugar
|
|||||||
this.CreateQueryJoin(joinExpression, types, queryable);
|
this.CreateQueryJoin(joinExpression, types, queryable);
|
||||||
return queryable;
|
return queryable;
|
||||||
}
|
}
|
||||||
public virtual ISugarQueryable<T, T2, T3> Queryable<T, T2, T3>(Expression<Func<T, T2, T3, object[]>> joinExpression)
|
public virtual ISugarQueryable<T, T2, T3> Queryable<T, T2, T3>(Expression<Func<T, T2, T3, object[]>> joinExpression)
|
||||||
{
|
{
|
||||||
InitMppingInfo<T, T2, T3>();
|
InitMppingInfo<T, T2, T3>();
|
||||||
var types = new Type[] { typeof(T2), typeof(T3) };
|
var types = new Type[] { typeof(T2), typeof(T3) };
|
||||||
@ -146,7 +147,7 @@ namespace SqlSugar
|
|||||||
this.CreateQueryJoin(joinExpression, types, queryable);
|
this.CreateQueryJoin(joinExpression, types, queryable);
|
||||||
return queryable;
|
return queryable;
|
||||||
}
|
}
|
||||||
public virtual ISugarQueryable<T, T2, T3, T4> Queryable<T, T2, T3, T4>(Expression<Func<T, T2, T3, T4, object[]>> joinExpression)
|
public virtual ISugarQueryable<T, T2, T3, T4> Queryable<T, T2, T3, T4>(Expression<Func<T, T2, T3, T4, object[]>> joinExpression)
|
||||||
{
|
{
|
||||||
InitMppingInfo<T, T2, T3, T4>();
|
InitMppingInfo<T, T2, T3, T4>();
|
||||||
var types = new Type[] { typeof(T2), typeof(T3), typeof(T4) };
|
var types = new Type[] { typeof(T2), typeof(T3), typeof(T4) };
|
||||||
@ -154,7 +155,7 @@ namespace SqlSugar
|
|||||||
this.CreateQueryJoin(joinExpression, types, queryable);
|
this.CreateQueryJoin(joinExpression, types, queryable);
|
||||||
return queryable;
|
return queryable;
|
||||||
}
|
}
|
||||||
public virtual ISugarQueryable<T, T2, T3, T4, T5> Queryable<T, T2, T3, T4, T5>(Expression<Func<T, T2, T3, T4, T5, object[]>> joinExpression)
|
public virtual ISugarQueryable<T, T2, T3, T4, T5> Queryable<T, T2, T3, T4, T5>(Expression<Func<T, T2, T3, T4, T5, object[]>> joinExpression)
|
||||||
{
|
{
|
||||||
InitMppingInfo<T, T2, T3, T4, T5>();
|
InitMppingInfo<T, T2, T3, T4, T5>();
|
||||||
var types = new Type[] { typeof(T2), typeof(T3), typeof(T4), typeof(T5) };
|
var types = new Type[] { typeof(T2), typeof(T3), typeof(T4), typeof(T5) };
|
||||||
@ -162,7 +163,7 @@ namespace SqlSugar
|
|||||||
this.CreateQueryJoin(joinExpression, types, queryable);
|
this.CreateQueryJoin(joinExpression, types, queryable);
|
||||||
return queryable;
|
return queryable;
|
||||||
}
|
}
|
||||||
public virtual ISugarQueryable<T, T2, T3, T4, T5, T6> Queryable<T, T2, T3, T4, T5, T6>(Expression<Func<T, T2, T3, T4, T5, T6, object[]>> joinExpression)
|
public virtual ISugarQueryable<T, T2, T3, T4, T5, T6> Queryable<T, T2, T3, T4, T5, T6>(Expression<Func<T, T2, T3, T4, T5, T6, object[]>> joinExpression)
|
||||||
{
|
{
|
||||||
InitMppingInfo<T, T2, T3, T4, T5, T6>();
|
InitMppingInfo<T, T2, T3, T4, T5, T6>();
|
||||||
var types = new Type[] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6) };
|
var types = new Type[] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6) };
|
||||||
@ -170,7 +171,7 @@ namespace SqlSugar
|
|||||||
this.CreateQueryJoin(joinExpression, types, queryable);
|
this.CreateQueryJoin(joinExpression, types, queryable);
|
||||||
return queryable;
|
return queryable;
|
||||||
}
|
}
|
||||||
public virtual ISugarQueryable<T, T2, T3, T4, T5, T6, T7> Queryable<T, T2, T3, T4, T5, T6, T7>(Expression<Func<T, T2, T3, T4, T5, T6, T7, object[]>> joinExpression)
|
public virtual ISugarQueryable<T, T2, T3, T4, T5, T6, T7> Queryable<T, T2, T3, T4, T5, T6, T7>(Expression<Func<T, T2, T3, T4, T5, T6, T7, object[]>> joinExpression)
|
||||||
{
|
{
|
||||||
InitMppingInfo<T, T2, T3, T4, T5, T6, T7>();
|
InitMppingInfo<T, T2, T3, T4, T5, T6, T7>();
|
||||||
var types = new Type[] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7) };
|
var types = new Type[] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7) };
|
||||||
@ -178,7 +179,7 @@ namespace SqlSugar
|
|||||||
this.CreateQueryJoin(joinExpression, types, queryable);
|
this.CreateQueryJoin(joinExpression, types, queryable);
|
||||||
return queryable;
|
return queryable;
|
||||||
}
|
}
|
||||||
public virtual ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8> Queryable<T, T2, T3, T4, T5, T6, T7, T8>(Expression<Func<T, T2, T3, T4, T5, T6, T7, T8, object[]>> joinExpression)
|
public virtual ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8> Queryable<T, T2, T3, T4, T5, T6, T7, T8>(Expression<Func<T, T2, T3, T4, T5, T6, T7, T8, object[]>> joinExpression)
|
||||||
{
|
{
|
||||||
InitMppingInfo<T, T2, T3, T4, T5, T6, T7, T8>();
|
InitMppingInfo<T, T2, T3, T4, T5, T6, T7, T8>();
|
||||||
var types = new Type[] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8) };
|
var types = new Type[] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8) };
|
||||||
@ -203,7 +204,7 @@ namespace SqlSugar
|
|||||||
this.CreateQueryJoin(joinExpression, types, queryable);
|
this.CreateQueryJoin(joinExpression, types, queryable);
|
||||||
return queryable;
|
return queryable;
|
||||||
}
|
}
|
||||||
public virtual ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Queryable<T, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(Expression<Func<T, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, object[]>> joinExpression)
|
public virtual ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Queryable<T, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(Expression<Func<T, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, object[]>> joinExpression)
|
||||||
{
|
{
|
||||||
InitMppingInfo<T, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>();
|
InitMppingInfo<T, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>();
|
||||||
var types = new Type[] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10), typeof(T11) };
|
var types = new Type[] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10), typeof(T11) };
|
||||||
@ -211,7 +212,7 @@ namespace SqlSugar
|
|||||||
this.CreateQueryJoin(joinExpression, types, queryable);
|
this.CreateQueryJoin(joinExpression, types, queryable);
|
||||||
return queryable;
|
return queryable;
|
||||||
}
|
}
|
||||||
public virtual ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Queryable<T, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(Expression<Func<T, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, object[]>> joinExpression)
|
public virtual ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Queryable<T, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(Expression<Func<T, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, object[]>> joinExpression)
|
||||||
{
|
{
|
||||||
InitMppingInfo<T, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>();
|
InitMppingInfo<T, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>();
|
||||||
var types = new Type[] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10), typeof(T11), typeof(T12) };
|
var types = new Type[] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10), typeof(T11), typeof(T12) };
|
||||||
@ -267,7 +268,7 @@ namespace SqlSugar
|
|||||||
}
|
}
|
||||||
public virtual ISugarQueryable<T, T2, T3, T4, T5, T6, T7> Queryable<T, T2, T3, T4, T5, T6, T7>(Expression<Func<T, T2, T3, T4, T5, T6, T7, bool>> joinExpression) where T : class, new()
|
public virtual ISugarQueryable<T, T2, T3, T4, T5, T6, T7> Queryable<T, T2, T3, T4, T5, T6, T7>(Expression<Func<T, T2, T3, T4, T5, T6, T7, bool>> joinExpression) where T : class, new()
|
||||||
{
|
{
|
||||||
InitMppingInfo<T, T2, T3, T4, T5, T6,T7>();
|
InitMppingInfo<T, T2, T3, T4, T5, T6, T7>();
|
||||||
var types = new Type[] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7) };
|
var types = new Type[] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7) };
|
||||||
var queryable = InstanceFactory.GetQueryable<T, T2, T3, T4, T5, T6, T7>(this.CurrentConnectionConfig);
|
var queryable = InstanceFactory.GetQueryable<T, T2, T3, T4, T5, T6, T7>(this.CurrentConnectionConfig);
|
||||||
this.CreateEasyQueryJoin(joinExpression, types, queryable);
|
this.CreateEasyQueryJoin(joinExpression, types, queryable);
|
||||||
@ -276,7 +277,7 @@ namespace SqlSugar
|
|||||||
}
|
}
|
||||||
public virtual ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8> Queryable<T, T2, T3, T4, T5, T6, T7, T8>(Expression<Func<T, T2, T3, T4, T5, T6, T7, T8, bool>> joinExpression) where T : class, new()
|
public virtual ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8> Queryable<T, T2, T3, T4, T5, T6, T7, T8>(Expression<Func<T, T2, T3, T4, T5, T6, T7, T8, bool>> joinExpression) where T : class, new()
|
||||||
{
|
{
|
||||||
InitMppingInfo<T, T2, T3, T4, T5, T6,T7, T8>();
|
InitMppingInfo<T, T2, T3, T4, T5, T6, T7, T8>();
|
||||||
var types = new Type[] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8) };
|
var types = new Type[] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8) };
|
||||||
var queryable = InstanceFactory.GetQueryable<T, T2, T3, T4, T5, T6, T7, T8>(this.CurrentConnectionConfig);
|
var queryable = InstanceFactory.GetQueryable<T, T2, T3, T4, T5, T6, T7, T8>(this.CurrentConnectionConfig);
|
||||||
this.CreateEasyQueryJoin(joinExpression, types, queryable);
|
this.CreateEasyQueryJoin(joinExpression, types, queryable);
|
||||||
@ -287,7 +288,7 @@ namespace SqlSugar
|
|||||||
#region 9-12
|
#region 9-12
|
||||||
public virtual ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8, T9> Queryable<T, T2, T3, T4, T5, T6, T7, T8, T9>(Expression<Func<T, T2, T3, T4, T5, T6, T7, T8, T9, bool>> joinExpression) where T : class, new()
|
public virtual ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8, T9> Queryable<T, T2, T3, T4, T5, T6, T7, T8, T9>(Expression<Func<T, T2, T3, T4, T5, T6, T7, T8, T9, bool>> joinExpression) where T : class, new()
|
||||||
{
|
{
|
||||||
InitMppingInfo<T, T2, T3, T4, T5, T6,T7, T8, T9>();
|
InitMppingInfo<T, T2, T3, T4, T5, T6, T7, T8, T9>();
|
||||||
var types = new Type[] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9) };
|
var types = new Type[] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9) };
|
||||||
var queryable = InstanceFactory.GetQueryable<T, T2, T3, T4, T5, T6, T7, T8, T9>(this.CurrentConnectionConfig);
|
var queryable = InstanceFactory.GetQueryable<T, T2, T3, T4, T5, T6, T7, T8, T9>(this.CurrentConnectionConfig);
|
||||||
this.CreateEasyQueryJoin(joinExpression, types, queryable);
|
this.CreateEasyQueryJoin(joinExpression, types, queryable);
|
||||||
@ -296,7 +297,7 @@ namespace SqlSugar
|
|||||||
}
|
}
|
||||||
public virtual ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8, T9, T10> Queryable<T, T2, T3, T4, T5, T6, T7, T8, T9, T10>(Expression<Func<T, T2, T3, T4, T5, T6, T7, T8, T9, T10, bool>> joinExpression) where T : class, new()
|
public virtual ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8, T9, T10> Queryable<T, T2, T3, T4, T5, T6, T7, T8, T9, T10>(Expression<Func<T, T2, T3, T4, T5, T6, T7, T8, T9, T10, bool>> joinExpression) where T : class, new()
|
||||||
{
|
{
|
||||||
InitMppingInfo<T, T2, T3, T4, T5, T6,T7, T8, T9, T10>();
|
InitMppingInfo<T, T2, T3, T4, T5, T6, T7, T8, T9, T10>();
|
||||||
var types = new Type[] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10) };
|
var types = new Type[] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10) };
|
||||||
var queryable = InstanceFactory.GetQueryable<T, T2, T3, T4, T5, T6, T7, T8, T9, T10>(this.CurrentConnectionConfig);
|
var queryable = InstanceFactory.GetQueryable<T, T2, T3, T4, T5, T6, T7, T8, T9, T10>(this.CurrentConnectionConfig);
|
||||||
this.CreateEasyQueryJoin(joinExpression, types, queryable);
|
this.CreateEasyQueryJoin(joinExpression, types, queryable);
|
||||||
@ -305,7 +306,7 @@ namespace SqlSugar
|
|||||||
}
|
}
|
||||||
public virtual ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Queryable<T, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(Expression<Func<T, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, bool>> joinExpression) where T : class, new()
|
public virtual ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Queryable<T, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(Expression<Func<T, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, bool>> joinExpression) where T : class, new()
|
||||||
{
|
{
|
||||||
InitMppingInfo<T, T2, T3, T4, T5, T6,T7, T8, T9, T10, T11>();
|
InitMppingInfo<T, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>();
|
||||||
var types = new Type[] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10), typeof(T11) };
|
var types = new Type[] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10), typeof(T11) };
|
||||||
var queryable = InstanceFactory.GetQueryable<T, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(this.CurrentConnectionConfig);
|
var queryable = InstanceFactory.GetQueryable<T, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(this.CurrentConnectionConfig);
|
||||||
this.CreateEasyQueryJoin(joinExpression, types, queryable);
|
this.CreateEasyQueryJoin(joinExpression, types, queryable);
|
||||||
@ -314,7 +315,7 @@ namespace SqlSugar
|
|||||||
}
|
}
|
||||||
public virtual ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Queryable<T, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(Expression<Func<T, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, bool>> joinExpression) where T : class, new()
|
public virtual ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Queryable<T, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(Expression<Func<T, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, bool>> joinExpression) where T : class, new()
|
||||||
{
|
{
|
||||||
InitMppingInfo<T, T2, T3, T4, T5, T6,T7, T8, T9, T10, T11, T12>();
|
InitMppingInfo<T, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>();
|
||||||
var types = new Type[] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10), typeof(T11), typeof(T12) };
|
var types = new Type[] { typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6), typeof(T7), typeof(T8), typeof(T9), typeof(T10), typeof(T11), typeof(T12) };
|
||||||
var queryable = InstanceFactory.GetQueryable<T, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(this.CurrentConnectionConfig);
|
var queryable = InstanceFactory.GetQueryable<T, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(this.CurrentConnectionConfig);
|
||||||
this.CreateEasyQueryJoin(joinExpression, types, queryable);
|
this.CreateEasyQueryJoin(joinExpression, types, queryable);
|
||||||
@ -356,7 +357,7 @@ namespace SqlSugar
|
|||||||
var shortName1 = joinExpression.Parameters[0].Name;
|
var shortName1 = joinExpression.Parameters[0].Name;
|
||||||
var sqlObj1 = joinQueryable1.ToSql();
|
var sqlObj1 = joinQueryable1.ToSql();
|
||||||
string sql1 = sqlObj1.Key;
|
string sql1 = sqlObj1.Key;
|
||||||
UtilMethods.RepairReplicationParameters(ref sql1, sqlObj1.Value.ToArray(), 0,"Join");
|
UtilMethods.RepairReplicationParameters(ref sql1, sqlObj1.Value.ToArray(), 0, "Join");
|
||||||
queryable.QueryBuilder.EntityName = sqlBuilder.GetPackTable(sql1, shortName1); ;
|
queryable.QueryBuilder.EntityName = sqlBuilder.GetPackTable(sql1, shortName1); ;
|
||||||
queryable.QueryBuilder.Parameters.AddRange(sqlObj1.Value);
|
queryable.QueryBuilder.Parameters.AddRange(sqlObj1.Value);
|
||||||
|
|
||||||
@ -435,7 +436,7 @@ namespace SqlSugar
|
|||||||
public ISugarQueryable<T> SqlQueryable<T>(string sql) where T : class, new()
|
public ISugarQueryable<T> SqlQueryable<T>(string sql) where T : class, new()
|
||||||
{
|
{
|
||||||
var sqlBuilder = InstanceFactory.GetSqlbuilder(this.Context.CurrentConnectionConfig);
|
var sqlBuilder = InstanceFactory.GetSqlbuilder(this.Context.CurrentConnectionConfig);
|
||||||
return this.Context.Queryable<T>().AS(sqlBuilder.GetPackTable(sql, sqlBuilder.GetDefaultShortName())).With(SqlWith.Null).Select(sqlBuilder.GetDefaultShortName()+".*");
|
return this.Context.Queryable<T>().AS(sqlBuilder.GetPackTable(sql, sqlBuilder.GetDefaultShortName())).With(SqlWith.Null).Select(sqlBuilder.GetDefaultShortName() + ".*");
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@ -537,8 +538,8 @@ namespace SqlSugar
|
|||||||
}
|
}
|
||||||
public virtual IUpdateable<T> Updateable<T>() where T : class, new()
|
public virtual IUpdateable<T> Updateable<T>() where T : class, new()
|
||||||
{
|
{
|
||||||
var result= this.Context.Updateable(new T[] { new T() });
|
var result = this.Context.Updateable(new T[] { new T() });
|
||||||
result.UpdateParameterIsNull=true;
|
result.UpdateParameterIsNull = true;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
public virtual IUpdateable<T> Updateable<T>(Dictionary<string, object> columnDictionary) where T : class, new()
|
public virtual IUpdateable<T> Updateable<T>(Dictionary<string, object> columnDictionary) where T : class, new()
|
||||||
@ -567,13 +568,13 @@ namespace SqlSugar
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Saveable
|
#region Saveable
|
||||||
public ISaveable<T> Saveable<T>(List<T> saveObjects)where T:class,new()
|
public ISaveable<T> Saveable<T>(List<T> saveObjects) where T : class, new()
|
||||||
{
|
{
|
||||||
return new SaveableProvider<T>(this,saveObjects);
|
return new SaveableProvider<T>(this, saveObjects);
|
||||||
}
|
}
|
||||||
public ISaveable<T> Saveable<T>(T saveObject) where T : class, new()
|
public ISaveable<T> Saveable<T>(T saveObject) where T : class, new()
|
||||||
{
|
{
|
||||||
return new SaveableProvider<T>(this,saveObject);
|
return new SaveableProvider<T>(this, saveObject);
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@ -696,5 +697,142 @@ namespace SqlSugar
|
|||||||
this.Context.Ado.Dispose();
|
this.Context.Ado.Dispose();
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region Queue
|
||||||
|
public int SaveQueues(bool isTran = true)
|
||||||
|
{
|
||||||
|
return SaveQueuesProvider(isTran, (sql, parameters) => { return this.Ado.ExecuteCommand(sql, parameters); });
|
||||||
|
}
|
||||||
|
|
||||||
|
public Task<int> SaveQueuesAsync(bool isTran = true)
|
||||||
|
{
|
||||||
|
var result = new Task<int>(() => { return SaveQueues(isTran); });
|
||||||
|
result.Start();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
public List<T> SaveQueues<T>(bool isTran = true)
|
||||||
|
{
|
||||||
|
return SaveQueuesProvider(isTran, (sql, parameters) => { return this.Ado.SqlQuery<T>(sql, parameters); });
|
||||||
|
}
|
||||||
|
public Task<List<T>> SaveQueuesAsync<T>(bool isTran = true)
|
||||||
|
{
|
||||||
|
var result = new Task<List<T>>(() => { return SaveQueues<T>(); });
|
||||||
|
result.Start();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
public Tuple<List<T>, List<T2>> SaveQueues<T, T2>(bool isTran = true)
|
||||||
|
{
|
||||||
|
return SaveQueuesProvider(isTran, (sql, parameters) => { return this.Ado.SqlQuery<T, T2>(sql, parameters); });
|
||||||
|
}
|
||||||
|
public Task<Tuple<List<T>, List<T2>>> SaveQueuesAsync<T, T2>(bool isTran = true)
|
||||||
|
{
|
||||||
|
var result = new Task<Tuple<List<T>, List<T2>>>(() => { return SaveQueues<T, T2>(isTran); });
|
||||||
|
result.Start();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
public Tuple<List<T>, List<T2>, List<T3>> SaveQueues<T, T2, T3>(bool isTran = true)
|
||||||
|
{
|
||||||
|
return SaveQueuesProvider(isTran, (sql, parameters) => { return this.Ado.SqlQuery<T, T2, T3>(sql, parameters); });
|
||||||
|
}
|
||||||
|
public Task<Tuple<List<T>, List<T2>, List<T3>>> SaveQueuesAsync<T, T2, T3>(bool isTran = true)
|
||||||
|
{
|
||||||
|
var result = new Task<Tuple<List<T>, List<T2>, List<T3>>>(() => { return SaveQueues<T, T2, T3>(isTran); });
|
||||||
|
result.Start();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
public Tuple<List<T>, List<T2>, List<T3>, List<T4>> SaveQueues<T, T2, T3, T4>(bool isTran = true)
|
||||||
|
{
|
||||||
|
return SaveQueuesProvider(isTran, (sql, parameters) => { return this.Ado.SqlQuery<T, T2, T3, T4>(sql, parameters); });
|
||||||
|
}
|
||||||
|
public Task<Tuple<List<T>, List<T2>, List<T3>, List<T4>>> SaveQueuesAsync<T, T2, T3, T4>(bool isTran = true)
|
||||||
|
{
|
||||||
|
var result = new Task<Tuple<List<T>, List<T2>, List<T3>, List<T4>>>(() => { return SaveQueues<T, T2, T3, T4>(isTran); });
|
||||||
|
result.Start();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
public Tuple<List<T>, List<T2>, List<T3>, List<T4>, List<T5>> SaveQueues<T, T2, T3, T4, T5>(bool isTran = true)
|
||||||
|
{
|
||||||
|
return SaveQueuesProvider(isTran, (sql, parameters) => { return this.Ado.SqlQuery<T, T2, T3, T4, T5>(sql, parameters); });
|
||||||
|
}
|
||||||
|
public Task<Tuple<List<T>, List<T2>, List<T3>, List<T4>, List<T5>>> SaveQueuesAsync<T, T2, T3, T4, T5>(bool isTran = true)
|
||||||
|
{
|
||||||
|
var result = new Task<Tuple<List<T>, List<T2>, List<T3>, List<T4>, List<T5>>>(() => { return SaveQueues<T, T2, T3, T4, T5>(isTran); });
|
||||||
|
result.Start();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
public Tuple<List<T>, List<T2>, List<T3>, List<T4>, List<T5>, List<T6>> SaveQueues<T, T2, T3, T4, T5, T6>(bool isTran = true)
|
||||||
|
{
|
||||||
|
return SaveQueuesProvider(isTran, (sql, parameters) => { return this.Ado.SqlQuery<T, T2, T3, T4, T5, T6>(sql, parameters); });
|
||||||
|
}
|
||||||
|
public Task<Tuple<List<T>, List<T2>, List<T3>, List<T4>, List<T5>, List<T6>>> SaveQueuesAsync<T, T2, T3, T4, T5, T6>(bool isTran = true)
|
||||||
|
{
|
||||||
|
var result = new Task<Tuple<List<T>, List<T2>, List<T3>, List<T4>, List<T5>, List<T6>>>(() => { return SaveQueues<T, T2, T3, T4, T5, T6>(isTran); });
|
||||||
|
result.Start();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
public Tuple<List<T>, List<T2>, List<T3>, List<T4>, List<T5>, List<T6>, List<T7>> SaveQueues<T, T2, T3, T4, T5, T6, T7>(bool isTran = true)
|
||||||
|
{
|
||||||
|
return SaveQueuesProvider(isTran, (sql, parameters) => { return this.Ado.SqlQuery<T, T2, T3, T4, T5, T6, T7>(sql, parameters); });
|
||||||
|
}
|
||||||
|
public Task<Tuple<List<T>, List<T2>, List<T3>, List<T4>, List<T5>, List<T6>, List<T7>>> SaveQueuesAsync<T, T2, T3, T4, T5, T6, T7>(bool isTran = true)
|
||||||
|
{
|
||||||
|
var result = new Task<Tuple<List<T>, List<T2>, List<T3>, List<T4>, List<T5>, List<T6>, List<T7>>>(() => { return SaveQueues<T, T2, T3, T4, T5, T6, T7>(isTran); });
|
||||||
|
result.Start();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
public void AddQueue(string sql, object parsmeters=null)
|
||||||
|
{
|
||||||
|
if (Queues == null)
|
||||||
|
{
|
||||||
|
Queues = new QueueList();
|
||||||
|
}
|
||||||
|
this.Queues.Add(sql,this.Context.Ado.GetParameters(parsmeters));
|
||||||
|
}
|
||||||
|
public QueueList Queues = new QueueList();
|
||||||
|
|
||||||
|
private T SaveQueuesProvider<T>(bool isTran, Func<string, List<SugarParameter>, T> func)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (this.Queues == null || this.Queues.Count == 0) return default(T);
|
||||||
|
isTran = isTran && this.Ado.Transaction == null;
|
||||||
|
if (isTran) this.Ado.BeginTran();
|
||||||
|
StringBuilder sqlBuilder = new StringBuilder();
|
||||||
|
var parsmeters = new List<SugarParameter>();
|
||||||
|
var index = 1;
|
||||||
|
if (this.Queues.HasValue())
|
||||||
|
{
|
||||||
|
foreach (var item in Queues)
|
||||||
|
{
|
||||||
|
if (item.Sql == null)
|
||||||
|
item.Sql = string.Empty;
|
||||||
|
if (item.Parameters == null)
|
||||||
|
item.Parameters = new SugarParameter[] { };
|
||||||
|
var itemParsmeters = item.Parameters.OrderByDescending(it => it.ParameterName).ToList();
|
||||||
|
var itemSql = item.Sql;
|
||||||
|
foreach (var itemParameter in itemParsmeters)
|
||||||
|
{
|
||||||
|
var newName = itemParameter.ParameterName + "_q_" + index;
|
||||||
|
itemSql = itemSql.Replace(itemParameter.ParameterName, newName);
|
||||||
|
itemParameter.ParameterName = newName;
|
||||||
|
}
|
||||||
|
parsmeters.AddRange(itemParsmeters);
|
||||||
|
sqlBuilder.AppendLine(itemSql);
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.Queues.Clear();
|
||||||
|
var result = func(sqlBuilder.ToString(), parsmeters);
|
||||||
|
if (isTran) this.Ado.CommitTran();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (isTran) this.Ado.RollbackTran();
|
||||||
|
throw ex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user