Add ToArrayAsync

This commit is contained in:
sunkaixuna 2021-07-02 18:31:43 +08:00
parent fb09cb7ae3
commit 6506aa7de2
2 changed files with 10 additions and 0 deletions

View File

@ -880,6 +880,15 @@ namespace SqlSugar
else
return null;
}
public async virtual Task<T[]> ToArrayAsync()
{
var result =await this.ToListAsync();
if (result.HasValue())
return result.ToArray();
else
return null;
}
public virtual string ToJson()
{
if (IsCache)

View File

@ -133,6 +133,7 @@ namespace SqlSugar
Task<List<Dictionary<string, object>>> ToDictionaryListAsync();
T[] ToArray();
Task<T[]> ToArrayAsync();
Task<List<T>> ToListAsync();
string ToJson();