An easy to use framework for creating usage samples.
- Mark a class with the [Sample] attribute.
- Without Dependancy Injection (DI), ensure that a parameterless constructor is present.
- Mark at least one method with [Run], ensure that all parameters are supplied by DI.
- Create a ConsoleRunner instance, supplying a ConsoleRunnerInfo if desired.
- Subscribe to the BuildServiceProvider event of ConsoleRunner and add services used for dependency injection.
- ConsoleRunner.Find() either an entire assembly, or specify the types to find samples from.
- Finally, ConsoleRunner.Run().
All of the above is covered in the 'Samples' project, have a look at the Samples.Net samples (which is itself using Samples.Net... woah, meta).
- Attribute based approach to setting up samples.
- Support for dependency injection and named parameters.
- Support for async methods.