Skip to content

wild-code-school-projects/wild-dependencyInjection

Repository files navigation

wild-dependencyInjection

Use of Dependency injection with ASP.NET services.

Objective

Challenge

inject a QuarterlySalaryCalculator class as ISalaryCalculator using ASP.Net. The QuarterlySalaryCalculator class should convert an annual salary into a quarterly salary.

Validation Criteria

  • The files Controllers/SalaryController.cs, Services/MonthlySalaryCalculator.cs, Services/ISalaryCalculator.cs, and Program.cs remain unchanged in the solution.
  • A file Services/QuarterlySalaryCalculator.cs defines a class implementing the ISalaryCalculator interface.
  • The implementation of the CalculateSalary method in the QuarterlySalaryCalculator class converts an annual salary into a quarterly salary.
  • In the Program.cs file, a call to the AddScoped method injects QuarterlySalaryCalculator as ISalaryCalculator.
  • The route Api/Salary/{annualAmount} returns a quarterly salary.

image

About

Use of Dependency injection with ASP.NET services.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published