Update dependency-injection.md (#11637)
parent
c5d202e3ed
commit
27a55c70c8
|
@ -145,7 +145,7 @@ In the sample app, the `IMyDependency` service is registered with the concrete t
|
|||
> [!NOTE]
|
||||
> Each `services.Add{SERVICE_NAME}` extension method adds (and potentially configures) services. For example, `services.AddMvc()` adds the services Razor Pages and MVC require. We recommended that apps follow this convention. Place extension methods in the [Microsoft.Extensions.DependencyInjection](/dotnet/api/microsoft.extensions.dependencyinjection) namespace to encapsulate groups of service registrations.
|
||||
|
||||
If the service's constructor requires a primitive, such as a `string`, the primitive can be injected by using [configuration](xref:fundamentals/configuration/index) or the [options pattern](xref:fundamentals/configuration/options):
|
||||
If the service's constructor requires a [built in type](/dotnet/csharp/language-reference/keywords/built-in-types-table), such as a `string`, the type can be injected by using [configuration](xref:fundamentals/configuration/index) or the [options pattern](xref:fundamentals/configuration/options):
|
||||
|
||||
```csharp
|
||||
public class MyDependency : IMyDependency
|
||||
|
|
Loading…
Reference in New Issue