Skip to content

Commit

Permalink
updated README.
Browse files Browse the repository at this point in the history
  • Loading branch information
fiseni committed Oct 18, 2024
1 parent 16c7d39 commit e78cbdb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,18 @@ builder.Services.AddExtendedMediatR(cfg =>
});
```

The library provides an additional `Publish` extension to `IMediator`/`IPublisher` with a strategy parameter. You may choose a strategy on the fly.
The library provides an additional `Publish` extension that accepts a strategy as a parameter. You may choose a strategy on the fly.

```csharp
public class Foo(IPublisher publisher)
public class Foo(IMediator mediator)
{
public async Task Run(CancellationToken cancellationToken)
{
// The built-in behavior
await publisher.Publish(new Ping(), cancellationToken);
await mediator.Publish(new Ping(), cancellationToken);

// Publish with specific strategy
await publisher.Publish(new Ping(), PublishStrategy.WhenAll, cancellationToken);
await mediator.Publish(new Ping(), PublishStrategy.WhenAll, cancellationToken);
}
}
```
Expand Down
8 changes: 4 additions & 4 deletions readme-nuget.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,18 @@ builder.Services.AddExtendedMediatR(cfg =>
});
```

The library provides an additional `Publish` extension to `IMediator`/`IPublisher` with a strategy parameter. You may choose a strategy on the fly.
The library provides an additional `Publish` extension that accepts a strategy as a parameter. You may choose a strategy on the fly.

```csharp
public class Foo(IPublisher publisher)
public class Foo(IMediator mediator)
{
public async Task Run(CancellationToken cancellationToken)
{
// The built-in behavior
await publisher.Publish(new Ping(), cancellationToken);
await mediator.Publish(new Ping(), cancellationToken);

// Publish with specific strategy
await publisher.Publish(new Ping(), PublishStrategy.WhenAll, cancellationToken);
await mediator.Publish(new Ping(), PublishStrategy.WhenAll, cancellationToken);
}
}
```
Expand Down

0 comments on commit e78cbdb

Please sign in to comment.