Skip to content

Commit

Permalink
Merge pull request #102 from Medeah/patch-1
Browse files Browse the repository at this point in the history
Change example to use interface
  • Loading branch information
madelson authored Aug 23, 2021
2 parents e35a06e + 27d6879 commit 0e146cc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,15 @@ For applications that use [dependency injection](https://en.wikipedia.org/wiki/D

```C#
// in your Startup.cs:
services.AddSingleton(_ => new PostgresDistributedSynchronizationProvider(myConnectionString));
services.AddSingleton<IDistributedLockProvider>(_ => new PostgresDistributedSynchronizationProvider(myConnectionString));
services.AddTransient<SomeService>();

// in SomeService.cs
public class SomeService
{
private readonly PostgresDistributedSynchronizationProvider _synchronizationProvider;
private readonly IDistributedLockProvider _synchronizationProvider;

public SomeService(PostgresDistributedSynchronizationProvider synchronizationProvider)
public SomeService(IDistributedLockProvider synchronizationProvider)
{
this._synchronizationProvider = synchronizationProvider;
}
Expand Down

0 comments on commit 0e146cc

Please sign in to comment.