mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2026-02-25 04:27:14 +08:00
Update Core
This commit is contained in:
@@ -25,7 +25,7 @@ namespace SqlSugar
|
|||||||
public virtual string HasValue(MethodCallExpressionModel model)
|
public virtual string HasValue(MethodCallExpressionModel model)
|
||||||
{
|
{
|
||||||
var parameter = model.Args[0];
|
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)
|
public virtual string HasNumber(MethodCallExpressionModel model)
|
||||||
|
|||||||
@@ -78,8 +78,13 @@ namespace SqlSugar
|
|||||||
if (this.OrderByValue.IsNullOrEmpty())
|
if (this.OrderByValue.IsNullOrEmpty())
|
||||||
{
|
{
|
||||||
result += " ORDER BY GETDATE() ";
|
result += " ORDER BY GETDATE() ";
|
||||||
|
if(this.OldSql.HasValue())
|
||||||
|
this.OldSql += " ORDER BY GETDATE() ";
|
||||||
}
|
}
|
||||||
result += this.Offset;
|
result += this.Offset;
|
||||||
|
|
||||||
|
if (this.OldSql.HasValue())
|
||||||
|
this.OldSql += this.Offset;
|
||||||
}
|
}
|
||||||
result = GetSqlQuerySql(result);
|
result = GetSqlQuerySql(result);
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
return Context.Queryable<T>().Single(whereExpression);
|
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);
|
return Context.Queryable<T>().First(whereExpression);
|
||||||
}
|
}
|
||||||
@@ -232,7 +232,7 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
return Context.Queryable<T>().SingleAsync(whereExpression);
|
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);
|
return Context.Queryable<T>().FirstAsync(whereExpression);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ namespace SqlSugar
|
|||||||
if (rowSelector.Body is MemberExpression)
|
if (rowSelector.Body is MemberExpression)
|
||||||
rowName = ((MemberExpression)rowSelector.Body).Member.Name;
|
rowName = ((MemberExpression)rowSelector.Body).Member.Name;
|
||||||
else
|
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();
|
var columns = source.Select(columnSelector).Distinct();
|
||||||
|
|
||||||
cols = (new[] { rowName }).Concat(columns.Select(x => x.ToString())).ToList();
|
cols = (new[] { rowName }).Concat(columns.Select(x => x.ToString())).ToList();
|
||||||
|
|||||||
Reference in New Issue
Block a user