diff --git a/docs/site/docs/providing-input/inject-services-into-components.md b/docs/site/docs/providing-input/inject-services-into-components.md index 2ab9f32a9..e73c68efa 100644 --- a/docs/site/docs/providing-input/inject-services-into-components.md +++ b/docs/site/docs/providing-input/inject-services-into-components.md @@ -22,7 +22,7 @@ The following sections demonstrate how to do this. The examples we will cover wi Here is a test that registers the `IWeatherForecastService` in the `Services` collection, which is a requirement of the `` component listed above. -[!code-csharp[WeatherForecastsTest.cs](../../../samples/tests/xunit/WeatherForecastsTest.cs?start=17&end=25&highlight=2)] +[!code-csharp[WeatherForecastsTest.cs](../../../samples/tests/xunit/WeatherForecastsTest.cs?start=17&end=24&highlight=2)] The highlighted line shows how the `IWeatherForecastService` is registered in the test context's `Services` collection, which is just a standard [`IServiceCollection`](https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.dependencyinjection.iservicecollection), using the standard .NET Core dependency injection (DI) services method, [`AddSingleton`](https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.dependencyinjection.servicecollectionserviceextensions.addsingleton?view=dotnet-plat-ext-3.1#Microsoft_Extensions_DependencyInjection_ServiceCollectionServiceExtensions_AddSingleton__1_Microsoft_Extensions_DependencyInjection_IServiceCollection___0_).