For data providers that allow asynchronous operations, is the standard asynchronous method used?
If not, how do I deify this behavior?
For data providers that allow asynchronous operations, is the standard asynchronous method used?
If not, how do I deify this behavior?
I'm not sure what you mean with deify the behavior, but most of the data providers implements both the sync and async methods, for example the
FileDataProvider
:https://github.com/thepirat000/Audit.NET/blob/master/src/Audit.NET/Providers/FileDataProvider.cs
However, the base class of the data providers calls the sync method from the virtual async methods, so if a custom data provider does not overrides the async methods, they will just call the sync method within a new task:
https://github.com/thepirat000/Audit.NET/blob/8d410cb919f09d0c35f7c622d2e21913bcc46c59/src/Audit.NET/AuditDataProvider.cs#L58
Which one is called depends on the context. If you call the
Save()
orSaveAsync()
method on theAuditScope
, it will call the sync or async version respectively. And the same happens forDispose()
/DisposeAsync()
methods.Consider the following example: