Outline

Exercise: Add Config Dependency Injection

In the Conduit.Repositories Project we need to inject the configuration object into the Account Repository Class.

Modify Conduit.Repositories.AccountRepository.cs file
  • Add a private member
    • Type: IConfiguration
    • Name: Configuration
Modify the Constructor
  • Add parameter
    • Type: IConfiguration
    • Name: configuration
  • Assign the parameter value to the member

Take note of the upper- and lower-case character difference between the member and the parameter. In the next video I’ll show you my solution to injecting the configuration object.