dependency-injection

Radu Matei

6 minute read

Table of Content Introduction The need for registering services through a JSON file Adding the required packages Creating a dummy service How to inject an ITest service The JSON file The Service class Adding the services Testing the application The Startup class Conclusion Introduction “Back in the days” of ASP.NET 4.x, each of the framework components (MVC, WebAPI, OWIN, SignalR) had its own dependency resolver and its own way of integrating with the framework.

Introduction to ASP .NET Core MVC API

Create an ASP .NET Core MVC API

Radu Matei

8 minute read

Table of Content Introduction Adding the MVC services to our application Adding the Post class Creating an IPostRepository interface Creating an in-memory implementation of IPostRepository The PostController class Registering the repository service in Startup Startup.cs Testing the application Conclusion Introduction Up to this point, we have been learning about .NET Core and VS Code, about ASP .NET Core, the Startup class, Routing and how to use JSON Configuration.

ASP .NET Core JSON Configuration and Dependency Injection

Creating a configurable Greeting service with ASP .NET Core, using Dependency Injection

Radu Matei

11 minute read

Table of Content Introduction Using the ASP .NET Core JSON Configuration Provider Building the configurable Greeting service Making use of ASP .NET Core Dependency Injection Conclusion Introduction In the previous versions of ASP .NET, any configuration setting or parameter you needed was added in web.config (complete description of the old web.config file), or added in a separate XML file and referenced in web.config (for scenarios like database connection strings, or storing APIs access tokens).