DotNetCorePlugins/samples/dependency-injection
2022-06-04 21:23:10 -07:00
..
DI.HostApp Delete deprecated dependencies and drop support for everything < .NET 6 2022-06-04 21:09:40 -07:00
DI.SharedAbstractions Delete deprecated dependencies and drop support for everything < .NET 6 2022-06-04 21:09:40 -07:00
MyPlugin1 cleanup: run code formatter and cleanup 2021-01-30 15:41:10 -08:00
MyPlugin2 cleanup: run code formatter and cleanup 2021-01-30 15:41:10 -08:00
README.md Update release notes and README 2022-06-04 21:23:10 -07:00

Dependency Injection Sample

This sample contains 4 projects which demonstrate a plugin scenario which coordinates types between plugins using a dependency injection container.

  • 'DI.HostApp' is a console application which scans for a 'plugins' folder in its base directory and attempts to load any plugins it finds. It then configures plugins in a dependency injection collection.
  • 'DI.SharedAbstractions' which contains an interface shared by plugins and the host.
  • 'MyPlugin1' and 'MyPlugin2' implement shared abstractions and register them with the host.

Running the sample

Open a command line to this folder and run:

dotnet restore
dotnet run --project DI.HostApp/