mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-12-27 06:35:49 +08:00
Update exp to sql
This commit is contained in:
@@ -11,6 +11,7 @@ namespace SqlSugar
|
||||
public List<MethodCallExpressionArgs> Args { get; set; }
|
||||
public string Name { get; set; }
|
||||
public dynamic Data { get; set; }
|
||||
public object DataObject { get; set; }
|
||||
public Expression Expression { get; set; }
|
||||
public Expression BaseExpression { get; set; }
|
||||
public List<SugarParameter> Parameters { get; set; }
|
||||
|
||||
@@ -1129,7 +1129,7 @@ namespace SqlSugar
|
||||
{
|
||||
if (model.Conext?.SugarContext?.Context?.CurrentConnectionConfig?.MoreSettings?.DisableNvarchar != true)
|
||||
{
|
||||
if (columnInfo.SqlParameterDbType is System.Data.DbType type && type == System.Data.DbType.AnsiString)
|
||||
if (model.DataObject is DbColumnInfo dc&& dc.SqlParameterDbType is System.Data.DbType type && type == System.Data.DbType.AnsiString)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -308,6 +308,17 @@ namespace SqlSugar
|
||||
ConvetColumnFunc = this.Context.GetTranslationColumnName
|
||||
}
|
||||
});
|
||||
if (lamExp.Body is MethodCallExpression callExpression)
|
||||
{
|
||||
var callObject = callExpression.Object;
|
||||
|
||||
if (callObject is MemberExpression memberExpression && memberExpression?.Expression is ParameterExpression parameterExpression)
|
||||
{
|
||||
var entity = this.Context.SugarContext.Context.EntityMaintenance.GetEntityInfo(parameterExpression.Type);
|
||||
var columnInfo = entity.Columns.FirstOrDefault(it => it.PropertyName == memberExpression.Member.Name);
|
||||
model.DataObject = columnInfo;
|
||||
}
|
||||
}
|
||||
if (this.Context.IsSingle && this.Context.SingleTableNameSubqueryShortName == null)
|
||||
{
|
||||
ParameterExpressionVisitor visitor = new ParameterExpressionVisitor();
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<package >
|
||||
<metadata>
|
||||
<id>SqlSugarCore</id>
|
||||
<version>5.1.4.194-preview28</version>
|
||||
<version>5.1.4.194-preview31</version>
|
||||
<authors>sunkaixuan</authors>
|
||||
<owners>果糖大数据科技</owners>
|
||||
<licenseUrl>http://www.apache.org/licenses/LICENSE-2.0.html</licenseUrl>
|
||||
|
||||
Reference in New Issue
Block a user