EntityFrameworkCore documentation says I can get TransactionId on the output, but I cannot find it.
See original GitHub issueDescribe 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:
- Created 5 years ago
- Comments:5 (5 by maintainers)
Top 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 >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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
oh, you’re right. I got confused with the general Custom Actions… For the Entity Action, you could get the same with
eventEntry.GetEntry()
Documented via PR https://github.com/thepirat000/Audit.NET/pull/154