mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-10-27 11:19:15 +08:00
Synchronization code
This commit is contained in:
@@ -369,11 +369,18 @@ namespace SqlSugar
|
|||||||
}
|
}
|
||||||
|
|
||||||
public virtual string MappingColumn(MethodCallExpressionModel model)
|
public virtual string MappingColumn(MethodCallExpressionModel model)
|
||||||
|
{
|
||||||
|
if (model.Args.Count == 1)
|
||||||
|
{
|
||||||
|
return string.Format("{0}", model.Args[0].MemberValue);
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
var parameter = model.Args[0];
|
var parameter = model.Args[0];
|
||||||
var parameter1 = model.Args[1];
|
var parameter1 = model.Args[1];
|
||||||
return string.Format("{0}", parameter1.MemberValue);
|
return string.Format("{0}", parameter1.MemberValue);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public virtual string IsNull(MethodCallExpressionModel model)
|
public virtual string IsNull(MethodCallExpressionModel model)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -241,6 +241,7 @@ namespace SqlSugar
|
|||||||
public static int AggregateCount<TResult>(TResult thisValue) { throw new NotSupportedException("Can only be used in expressions"); }
|
public static int AggregateCount<TResult>(TResult thisValue) { throw new NotSupportedException("Can only be used in expressions"); }
|
||||||
public static int AggregateDistinctCount<TResult>(TResult thisValue) { throw new NotSupportedException("Can only be used in expressions"); }
|
public static int AggregateDistinctCount<TResult>(TResult thisValue) { throw new NotSupportedException("Can only be used in expressions"); }
|
||||||
public static TResult MappingColumn<TResult>(TResult type,string newColumnName) { throw new NotSupportedException("Can only be used in expressions"); }
|
public static TResult MappingColumn<TResult>(TResult type,string newColumnName) { throw new NotSupportedException("Can only be used in expressions"); }
|
||||||
|
public static TResult MappingColumn<TResult>(string newColumnName) { throw new NotSupportedException("Can only be used in expressions"); }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///Example: new NewT(){name=SqlFunc.GetSelfAndAutoFill(it)} Generated SQL it.*
|
///Example: new NewT(){name=SqlFunc.GetSelfAndAutoFill(it)} Generated SQL it.*
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -675,7 +675,14 @@ namespace SqlSugar
|
|||||||
var mappingColumnResult = this.Context.DbMehtods.MappingColumn(model);
|
var mappingColumnResult = this.Context.DbMehtods.MappingColumn(model);
|
||||||
var isValid = model.Args[0].IsMember && model.Args[1].IsMember == false;
|
var isValid = model.Args[0].IsMember && model.Args[1].IsMember == false;
|
||||||
//Check.Exception(!isValid, "SqlFunc.MappingColumn parameters error, The property name on the left, string value on the right");
|
//Check.Exception(!isValid, "SqlFunc.MappingColumn parameters error, The property name on the left, string value on the right");
|
||||||
|
if (model.Args.Count > 1)
|
||||||
|
{
|
||||||
this.Context.Parameters.RemoveAll(it => it.ParameterName == model.Args[1].MemberName.ObjToString());
|
this.Context.Parameters.RemoveAll(it => it.ParameterName == model.Args[1].MemberName.ObjToString());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.Context.Parameters.RemoveAll(it => it.ParameterName == model.Args[0].MemberName.ObjToString());
|
||||||
|
}
|
||||||
if (mappingColumnResult == "")
|
if (mappingColumnResult == "")
|
||||||
{
|
{
|
||||||
return model.Args[1].MemberName.ObjToString().TrimStart('\'').TrimEnd('\'');
|
return model.Args[1].MemberName.ObjToString().TrimStart('\'').TrimEnd('\'');
|
||||||
|
|||||||
Reference in New Issue
Block a user