question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

EntityFrameworkCore documentation says I can get TransactionId on the output, but I cannot find it.

See original GitHub issue

Describe the bug Documentation shows things like a ConnectionId, and TransactionId available on output. But for AuditEntityAction<T> I am only given the following: AuditEvent, Audit.EntityFramework.EventEntry, T.

To Reproduce

Audit.Core.Configuration.Setup()
    .UseEntityFramework(x => x                    
        .AuditTypeNameMapper(typeName => "Audit")                    
        .AuditEntityAction<IAudit>((auditEvent, eventEntry, auditEntity) =>
        {
            // auditEvent.TransactionId?
            // eventEntry.TransactionId?
        }));

Expected behavior One of the AuditEntityAction params should be an EFEntry.

Libraries (specify the Audit.NET extensions being used including version):

  • Core 2.1.3
  • Audit.EFC 12.3.5

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
thepirat000commented, Aug 23, 2018

oh, you’re right. I got confused with the general Custom Actions… For the Entity Action, you could get the same with eventEntry.GetEntry()

1reaction
VictorioBerracommented, Aug 23, 2018
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to get current transaction from the dbcontext
In Entity Framework 6, under the DbContext class you can get to current transaction by context. Database. CurrentTransaction.
Read more >
IDbContextTransaction.TransactionId Property
Gets the transaction identifier.
Read more >
SaveChanges fails for SQL Server because of savepoints ...
The current log warning says: Savepoints are disabled because Multiple Active Result Sets (MARS) is enabled. If 'SaveChanges' fails, then the ...
Read more >
Connection Resiliency - EF Core
An execution strategy that automatically retries on failures needs to be able to play back each operation in a retry block that fails....
Read more >
The instance of entity type cannot be tracked because ...
I am guided by a specific section of documentation which I have cited many times and will cite again: // The change tracker...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found