Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
thepirat000 authored Feb 15, 2024
1 parent 99b8b6f commit 2e06373
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -535,8 +535,8 @@ Audit.Core.Configuration.Setup()

#### Lazy Factory data provider

You can set the global data provider as a **lazy factory method** invoked until it is first used.
For example, when you require resolving dependencies from the DI container to instantiate the data provider:
You can set the global data provider using a deferred instantiation technique, with a **lazy factory method** that will be called upon its initial utilization.
For instance, in situations where dependency resolution is necessitated but not immediately accessible during initialization:

```c#
Audit.Core.Configuration.Setup()
Expand All @@ -545,8 +545,8 @@ Audit.Core.Configuration.Setup()

#### Deferred Factory data provider

You can defer creating the data provider for each Audit Event until it is ready to be saved by using
a **deferred factory method**. For example:
You can defer creating the data provider for each Audit Event until it is ready to be saved by using a **deferred factory method**.
This factory method will be called for each Audit Event. For example:

```c#
var sqlDataProvider = new SqlDataProvider(config => config...);
Expand All @@ -557,16 +557,7 @@ Audit.Core.Configuration.Setup()

```

See [Configuration section](#configuration) for more information.

To set the data provider per-scope, use the `AuditScopeOptions` when creating an `AuditScope`. For example:

```c#
var scope = AuditScope.Create(new AuditScopeOptions
{
DataProvider = new MyCustomDataProvider(), ... }
);
```
See [Wrapper data providers](#wrapper-data-providers) for more information.

### Dynamic data providers

Expand Down Expand Up @@ -634,6 +625,17 @@ A special type of Data Providers that allows wrapping other Data Providers with
.Otherwise(new FileDataProvider()));
```

#### Data provider per scope

To set the data provider per-scope, use the `AuditScopeOptions` when creating an `AuditScope`. For example:

```c#
var scope = AuditScope.Create(new AuditScopeOptions
{
DataProvider = new MyCustomDataProvider(), ... }
);
```

#### Data providers included

The Data Providers included are summarized in the following table:
Expand Down

0 comments on commit 2e06373

Please sign in to comment.