Add option to preserve CancellationToken parameters#115
Open
0xced wants to merge 1 commit intozompinc:masterfrom
Open
Add option to preserve CancellationToken parameters#1150xced wants to merge 1 commit intozompinc:masterfrom
0xced wants to merge 1 commit intozompinc:masterfrom
Conversation
6750016 to
ffe5b3f
Compare
It can still be useful to preserve the CancellationToken in some scenarios. For example, for [cancelling a synchronous bulk copy operation][1].
```csharp
bulkCopy.SqlRowsCopied += (_, e) =>
{
if (cancellationToken.IsCancellationRequested)
{
e.Abort = true;
}
};
```
I plan to submit a pull request at [PhenX.EntityFrameworkCore.BulkInsert][2] to use *Sync Method Generator* in order to greatly simplify async + sync methods implementations. 😉
[1]: https://github.com/PhenX/PhenX.EntityFrameworkCore.BulkInsert/blob/137d2fc8fed17b5aa7e6f11fccc079b7f463aff0/src/PhenX.EntityFrameworkCore.BulkInsert.SqlServer/SqlServerBulkInsertProvider.cs#L68-L74
[2]: https://github.com/PhenX/PhenX.EntityFrameworkCore.BulkInsert
ffe5b3f to
1f0b33f
Compare
0xced
added a commit
to 0xced/PhenX.EntityFrameworkCore.BulkInsert
that referenced
this pull request
Feb 23, 2026
…rt sync + async versions TODO: Wait for zompinc/sync-method-generator#115 to be merged and a new version to be released instead of using a ProjectReference which only works when the sync-method-generator repository is cloned at the right place on the right branch. In addition to simplifying the implementation, it also fixes "await using var partialInsertCommand" on the synchronous path in SqliteBulkInsertProvider.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It can still be useful to preserve the CancellationToken in some scenarios. For example, for cancelling a synchronous bulk copy operation.
I plan to submit a pull request at PhenX.EntityFrameworkCore.BulkInsert to use Sync Method Generator in order to greatly simplify async + sync methods implementations. 😉