mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-18 17:48:11 +08:00
-
This commit is contained in:
@@ -340,7 +340,11 @@ namespace SqlSugar
|
||||
|
||||
public int Count()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
SqlBuilder.LambadaQueryBuilder.IsCount = true;
|
||||
var sql = SqlBuilder.LambadaQueryBuilder.ToSqlString();
|
||||
var reval= Context.Database.GetInt(sql, SqlBuilder.LambadaQueryBuilder.QueryPars.ToArray());
|
||||
SqlBuilder.LambadaQueryBuilder.IsCount = false;
|
||||
return reval;
|
||||
}
|
||||
|
||||
public TResult Max<TResult>(string maxField)
|
||||
|
@@ -28,6 +28,7 @@ namespace SqlSugar
|
||||
#endregion
|
||||
|
||||
#region Splicing basic
|
||||
public bool IsCount { get; set; }
|
||||
public int? Skip { get; set; }
|
||||
public int? Take { get; set; }
|
||||
public string OrderByValue { get; set; }
|
||||
@@ -174,6 +175,7 @@ namespace SqlSugar
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.IsCount) return " COUNT(1) ";
|
||||
string reval = string.Empty;
|
||||
if (this.SelectValue == null || this.SelectValue is string)
|
||||
{
|
||||
|
Reference in New Issue
Block a user