Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim-Maes committed Oct 17, 2023
1 parent b9d5f74 commit 728529e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ dotnet add package Bindicate
Add this line in a project to register all decorated services. You can repeat this line and pass any assembly.

```csharp
services.AddAutowiringForAssembly(Assembly.GetExecutingAssembly());
services.AddAutowiringForAssembly(Assembly.GetAssembly(typeof(IInterface)));
services.AddAutowiringForAssembly(Assembly.GetExecutingAssembly()); // Register all types in current project
services.AddAutowiringForAssembly(Assembly.GetAssembly(typeof(IInterface))); // Register types from referenced project
```

**Register Services Across Multiple Assemblies**
Expand All @@ -58,11 +59,13 @@ If you want to scan and register services across all loaded assemblies, you can
***Note** that this might not work if not all assemblies are loaded at this point in startup configuration*!

```csharp
// Trigger loading assemblies to be able to use AddAutowiring:
// Trigger loading of unloaded assemblies to be able to use AddAutowiring:
var triggerAssembly1 = typeof(ProjectName.SomeType);
var triggerAssembly2 = typeof(OtherProjectName.SomeOtherType);

services.AddAutowiring();

//Or just use AddAutowiringForAssembly method
```

## Decorate your services:
Expand Down

0 comments on commit 728529e

Please sign in to comment.