Add CancellationToken support for MultiMap Queries.
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 18.4k
- Forks
- 3.7k
- Avg merge
- 5h 8m
- Merged PRs (30d)
- 1
Description
Add overload methods for MultiMap queries to pass CancellationToken to CommandDefinition.
From this:
public static IEnumerable<TReturn> Query<TReturn>(this IDbConnection cnn, string sql, Type[] types, Func<object[], TReturn> map, object? param = null, IDbTransaction? transaction = null, bool buffered = true, string splitOn = "Id", int? commandTimeout = null, CommandType? commandType = null)
{
var command = new CommandDefinition(sql, param, transaction, commandTimeout, commandType, buffered ? CommandFlags.Buffered : CommandFlags.None);
var results = MultiMapImpl(cnn, command, types, map, splitOn, null, null, true);
return buffered ? results.ToList() : results;
}
To this:
public static IEnumerable<TReturn> Query<TReturn>(this IDbConnection cnn, string sql, Type[] types, Func<object[], TReturn> map, object? param = null, IDbTransaction? transaction = null, bool buffered = true, string splitOn = "Id", int? commandTimeout = null, CommandType? commandType = null, CancellationToken ct = CancellationToken.None)
{
var command = new CommandDefinition(sql, param, transaction, commandTimeout, commandType, buffered ? CommandFlags.Buffered : CommandFlags.None, ct);
var results = MultiMapImpl(cnn, command, types, map, splitOn, null, null, true);
return buffered ? results.ToList() : results;
}
EDIT:
Another aproach would be to give access to some private methods like:
MultiMapImpl
where we could manually build CommandDefinition with CancellationToken assigned to it.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the MultiMap Query overload shown in the issue and trace how it calls MultiMapImpl and constructs CommandDefinition. Identify the related MultiMap overloads that need the same CancellationToken support; done means callers can pass a token through to CommandDefinition for these queries.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100