Extend AuditBehavior
See original GitHub issueHi,
I need a dynamic behavior in Audit.WCF
,
That is: one service must to audit to X table, and other service to Y table.
I want them to use in a differents attributes, something like this:
public class AuditMainApp : AuditBehaviorAttribute { protected override object CreateBehavior() { (CurrentAuditScope.DataProvider as SqlDataProvider).TableName = "AuditEvent_App"; return base.CreateBehavior(); } }
but the AuditBehaviorAttribute
is sealed
there is another nice way to do that?
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
IRS Audits | Internal Revenue Service
An IRS audit is a review/examination of an organization's or individual's accounts and financial information to ensure information is reported correctly ...
Read more >IRS Can Audit for Three Years, Six, or Forever: Here's How ...
On the other hand, if you file late and do not have an extension, the statute runs three years following your actual (late)...
Read more >Advanced security audit policy settings (Windows 10)
These advanced audit policy settings allow you to select only the behaviors that you want to monitor. You can exclude audit results for...
Read more >Key behaviors of an agile-minded internal audit leader
#1. Agile-minded IA leaders build rapid feedback loops · Undertake rapid feedback loops with stakeholders (audit committee, senior management, ...
Read more >IRS Audits Few Millionaires But Targeted Many Low-Income ...
“The IRS correspondence audit process is structured to expend the least amount of resources to conduct the largest number of examinations ...
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
That’s not the way to go. You should not change the tablename of the sql data provider because it will be shared among threads.
You have some ways to accomplish what you want, for example creating a custom data provider that wraps different instances of the sqldataprovider, one for each table.
But since what you’re asking sounds familiar, I will better enhance the
SqlDataProvider
to allow changing the parameters dynamically. For example, instead of setting a TableName as a string, you could set a TableNameBuilder that is a function of the audit event, so you can for example use the EventType (or whatever you want) to define the table name per event:And on your service:
Will work on this enhancement and let you know.
Working good! Thank’s for the most quicly response I got…