Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API to get current transaction #5552

Closed
rowanmiller opened this issue May 27, 2016 · 1 comment
Closed

API to get current transaction #5552

rowanmiller opened this issue May 27, 2016 · 1 comment
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-enhancement
Milestone

Comments

@rowanmiller
Copy link
Contributor

When we moved transactions to core we lost a top level API to get the current transaction, we should add one.

@rjperes
Copy link

rjperes commented Jun 12, 2016

There is a way:

var dbtxmgr = ctx.GetInfrastructure().GetService<IDbContextTransactionManager>();
var relcon = dbtxmgr as IRelationalConnection;
var dbtx = relcon.CurrentTransaction;
var tx = dbtx.GetDbTransaction();

Right?

@ajcvickers ajcvickers self-assigned this Jun 24, 2016
ajcvickers added a commit that referenced this issue Jul 1, 2016
@ajcvickers ajcvickers added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Jul 6, 2016
@ajcvickers ajcvickers modified the milestones: 1.1.0-preview1, 1.1.0 Oct 15, 2022
@ajcvickers ajcvickers removed their assignment Sep 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-enhancement
Projects
None yet
Development

No branches or pull requests

3 participants