mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-07-16 16:50:41 +08:00
49 lines
1.4 KiB
C#
49 lines
1.4 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data.SqlClient;
|
|
using System.Linq;
|
|
using System.Linq.Expressions;
|
|
using System.Text;
|
|
|
|
namespace SqlSugar
|
|
{
|
|
public class QueryableAccessory
|
|
{
|
|
protected List<SugarParameter> _Pars;
|
|
protected ILambdaExpressions _LambdaExpressions;
|
|
protected List<SugarParameter> BasePars
|
|
{
|
|
get
|
|
{
|
|
if (_Pars == null)
|
|
_Pars = new List<SugarParameter>();
|
|
return _Pars;
|
|
}
|
|
|
|
}
|
|
protected void AddPars(object whereObj, SqlSugarClient context)
|
|
{
|
|
var sqlParsArray = context.Database.GetParameters(whereObj);
|
|
if (sqlParsArray != null)
|
|
this.BasePars.AddRange(sqlParsArray);
|
|
}
|
|
protected void AddPars(List<SugarParameter> pars, SqlSugarClient context)
|
|
{
|
|
if (_Pars == null)
|
|
_Pars = new List<SugarParameter>();
|
|
_Pars.AddRange(pars);
|
|
}
|
|
|
|
protected void SetSelectType(SqlSugarClient context,ISqlBuilder builder)
|
|
{
|
|
var type = ResolveExpressType.SelectSingle;
|
|
if (builder.LambadaQueryBuilder.JoinQueryInfos.IsValuable())
|
|
{
|
|
type = ResolveExpressType.SelectMultiple;
|
|
}
|
|
builder.LambadaQueryBuilder.ResolveType = type;
|
|
}
|
|
|
|
}
|
|
}
|