mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-11-08 10:24:55 +08:00
-
This commit is contained in:
@@ -340,7 +340,11 @@ namespace SqlSugar
|
|||||||
|
|
||||||
public int Count()
|
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)
|
public TResult Max<TResult>(string maxField)
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ namespace SqlSugar
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Splicing basic
|
#region Splicing basic
|
||||||
|
public bool IsCount { get; set; }
|
||||||
public int? Skip { get; set; }
|
public int? Skip { get; set; }
|
||||||
public int? Take { get; set; }
|
public int? Take { get; set; }
|
||||||
public string OrderByValue { get; set; }
|
public string OrderByValue { get; set; }
|
||||||
@@ -174,6 +175,7 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
|
if (this.IsCount) return " COUNT(1) ";
|
||||||
string reval = string.Empty;
|
string reval = string.Empty;
|
||||||
if (this.SelectValue == null || this.SelectValue is string)
|
if (this.SelectValue == null || this.SelectValue is string)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user