update SqlMiddle

This commit is contained in:
sunkaixuan 2022-03-27 22:23:10 +08:00
parent 0e20065f8b
commit 3c4f620579
2 changed files with 17 additions and 9 deletions

View File

@ -199,6 +199,14 @@ namespace OrmTest
},2,10,ref count,5);
var test33= db.Queryable<Order>().ToList();
db.CurrentConnectionConfig.SqlMiddle = new SqlMiddle
{
IsSqlMiddle=true,
ExecuteCommand = (s, p)=>{ return s.Length; }
};
var five=db.Ado.ExecuteCommand("11111");
db.CurrentConnectionConfig.SqlMiddle = null;
Console.WriteLine("#### Examples End ####");
}

View File

@ -68,16 +68,16 @@ namespace SqlSugar
public SqlMiddle SqlMiddle { get; set; }
}
public class SqlMiddle
{
{
public bool? IsSqlMiddle { get; set; }
public Func<string ,SugarParameter[],object> GetScalar { get; set; }
public Func<string, SugarParameter[],int> ExecuteCommand { get; set; }
public Func<string, SugarParameter[],IDataReader> GetDataReader { get; set; }
public Func<string, SugarParameter[],DataSet> GetDataSetAll { get; set; }
public Func<string, SugarParameter[], Task<object>> GetScalarAsync { get; set; }
public Func<string, SugarParameter[], Task<int>> ExecuteCommandAsync { get; set; }
public Func<string, SugarParameter[], Task<IDataReader>> GetDataReaderAsync { get; set; }
public Func<string, SugarParameter[], Task<DataSet>> GetDataSetAllAsync { get; set; }
public Func<string, SugarParameter[], object> GetScalar { get; set; } = (s,p) => throw new NotSupportedException("SqlMiddle.GetScalar");
public Func<string, SugarParameter[],int> ExecuteCommand { get; set; } = (s, p) => throw new NotSupportedException("SqlMiddle.ExecuteCommand");
public Func<string, SugarParameter[],IDataReader> GetDataReader { get; set; } = (s, p) => throw new NotSupportedException("SqlMiddle.GetDataReader");
public Func<string, SugarParameter[],DataSet> GetDataSetAll { get; set; } = (s, p) => throw new NotSupportedException("SqlMiddle.GetDataSetAll");
public Func<string, SugarParameter[], Task<object>> GetScalarAsync { get; set; } = (s, p) => throw new NotSupportedException("SqlMiddle.GetScalarAsync");
public Func<string, SugarParameter[], Task<int>> ExecuteCommandAsync { get; set; } = (s, p) => throw new NotSupportedException("SqlMiddle.ExecuteCommandAsync");
public Func<string, SugarParameter[], Task<IDataReader>> GetDataReaderAsync { get; set; } = (s, p) => throw new NotSupportedException("SqlMiddle.GetDataReaderAsync");
public Func<string, SugarParameter[], Task<DataSet>> GetDataSetAllAsync { get; set; } = (s, p) => throw new NotSupportedException("SqlMiddle.GetDataSetAllAsync");
}
public class AopEvents