Skip to content

Commit

Permalink
feat(methods): add overloads without parameter list for asyncs
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasSchubert committed Jan 28, 2024
1 parent ba85756 commit 15e78ad
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Command/Methods/SnowflakeCommand.FirstOrDefaultAsync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ namespace Snowflake.Data.Xt;
public partial class SnowflakeCommand<T>
where T : class
{
/// <summary>
/// Gets the first item for a query or null if none is found.
/// </summary>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>The first item if found, otherwise null.</returns>
public Task<T?> FirstOrDefaultAsync(CancellationToken cancellationToken = default)
{
return this.FirstOrDefaultAsync(new List<(string, DbType, object)>() { }, cancellationToken);
}

/// <summary>
/// Gets the first item for a query or null if none is found.
/// </summary>
Expand Down
10 changes: 10 additions & 0 deletions src/Command/Methods/SnowflakeCommand.ToListAsync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ namespace Snowflake.Data.Xt;
public partial class SnowflakeCommand<T>
where T : class
{
/// <summary>
/// Gets a list of items for a query.
/// </summary>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>A list of items.</returns>
public Task<IList<T>> ToListAsync(CancellationToken cancellationToken = default)
{
return this.ToListAsync(new List<(string, DbType, object)>() { }, cancellationToken);
}

/// <summary>
/// Gets a list of items for a query.
/// </summary>
Expand Down

0 comments on commit 15e78ad

Please sign in to comment.