mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-01 10:10:16 +08:00
Update Core
This commit is contained in:
parent
e32ac64207
commit
0715cfba40
@ -25,7 +25,7 @@ namespace SqlSugar
|
||||
public virtual string HasValue(MethodCallExpressionModel model)
|
||||
{
|
||||
var parameter = model.Args[0];
|
||||
return string.Format("( {0}<>'' AND {0} IS NOT NULL )", parameter.MemberName);
|
||||
return string.Format("({0} IS NOT NULL )", parameter.MemberName);
|
||||
}
|
||||
|
||||
public virtual string HasNumber(MethodCallExpressionModel model)
|
||||
|
@ -78,8 +78,13 @@ namespace SqlSugar
|
||||
if (this.OrderByValue.IsNullOrEmpty())
|
||||
{
|
||||
result += " ORDER BY GETDATE() ";
|
||||
if(this.OldSql.HasValue())
|
||||
this.OldSql += " ORDER BY GETDATE() ";
|
||||
}
|
||||
result += this.Offset;
|
||||
|
||||
if (this.OldSql.HasValue())
|
||||
this.OldSql += this.Offset;
|
||||
}
|
||||
result = GetSqlQuerySql(result);
|
||||
return result;
|
||||
|
@ -102,7 +102,7 @@ namespace SqlSugar
|
||||
{
|
||||
return Context.Queryable<T>().Single(whereExpression);
|
||||
}
|
||||
public T GetFirst(Expression<Func<T, bool>> whereExpression)
|
||||
public virtual T GetFirst(Expression<Func<T, bool>> whereExpression)
|
||||
{
|
||||
return Context.Queryable<T>().First(whereExpression);
|
||||
}
|
||||
@ -232,7 +232,7 @@ namespace SqlSugar
|
||||
{
|
||||
return Context.Queryable<T>().SingleAsync(whereExpression);
|
||||
}
|
||||
public Task<T> GetFirstAsync(Expression<Func<T, bool>> whereExpression)
|
||||
public virtual Task<T> GetFirstAsync(Expression<Func<T, bool>> whereExpression)
|
||||
{
|
||||
return Context.Queryable<T>().FirstAsync(whereExpression);
|
||||
}
|
||||
|
@ -86,7 +86,7 @@ namespace SqlSugar
|
||||
if (rowSelector.Body is MemberExpression)
|
||||
rowName = ((MemberExpression)rowSelector.Body).Member.Name;
|
||||
else
|
||||
rowName = string.Join(UtilConstants.ReplaceKey, ((NewExpression)rowSelector.Body).Arguments.Select(it => it as MemberExpression).Select(it => it.Member.Name));
|
||||
rowName = "Group_"+string.Join("_", ((NewExpression)rowSelector.Body).Arguments.Select(it => it as MemberExpression).Select(it => it.Member.Name));
|
||||
var columns = source.Select(columnSelector).Distinct();
|
||||
|
||||
cols = (new[] { rowName }).Concat(columns.Select(x => x.ToString())).ToList();
|
||||
|
Loading…
Reference in New Issue
Block a user