public async Task <int> Count(SqlessCountRequest request) { await OpenSqlConnection(); SqlessCountSqlBuilder selectSqlProducer = new SqlessCountSqlBuilder(this, request); return(await selectSqlProducer.ExecuteScalarAsync <int>()); }
public async Task CountDistinctSqlTest() { using Sqless sqless = new Sqless(Global.AllowUnspecifiedConfig); SqlessCountSqlBuilder producer = new SqlessCountSqlBuilder(sqless, SqlessCountDistinctRequest); var sqlStr = await producer.GetSqlStrTest(); Assert.AreEqual(sqlStr.Replace(" ", " ").Trim(), "SELECT COUNT(DISTINCT [Uid]) FROM [User]"); }