Skip to content

Commit

Permalink
Renamed TypeRegistrar to MyTypeRegistrar, making it more obvious it i…
Browse files Browse the repository at this point in the history
…s a custom class the user must provide.
  • Loading branch information
FrankRay78 committed Aug 24, 2024
1 parent fc9861a commit 6e14044
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/input/cli/commandApp.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ registrations.AddSingleton<IGreeter, HelloWorldGreeter>();

// Create a type registrar and register any dependencies.
// A type registrar is an adapter for a DI framework.
var registrar = new TypeRegistrar(registrations);
var registrar = new MyTypeRegistrar(registrations);

// Create a new command app with the registrar
// and run it with the provided arguments.
Expand All @@ -76,7 +76,7 @@ return app.Run(args);
```

<?# Alert ?>
`TypeRegistrar` is a custom class that implements [ITypeRegistrar](xref:T:Spectre.Console.Cli.ITypeRegistrar) and must be provided by the user.
`MyTypeRegistrar` is a custom class that implements [ITypeRegistrar](xref:T:Spectre.Console.Cli.ITypeRegistrar) and must be provided by the user.
<?#/ Alert ?>

There is a working [example of dependency injection](https://github.com/spectreconsole/examples/tree/main/examples/Cli/Injection) that uses `Microsoft.Extensions.DependencyInjection` as the container. Example implementations of `ITypeRegistrar` and `ITypeResolver` are provided, which you can copy and paste to your application for dependency injection.
Expand Down

0 comments on commit 6e14044

Please sign in to comment.