ASP.NET MVC Interview Questions Part - IIl Day 27
Lecture 27 : ASP.NET MVC Interview Questions Part - III 1) What is dependency injection ? Injecting the dependent object by some one else rather than controller creating. Dependency injection is a design pattern in which a class requests dependencies from external sources rather than creating them. Angular's DI framework provides dependencies to a class upon instantiation. You can use Angular DI to increase flexibility and modularity in your applications. 2) How can we read Configuration data from appsettings.json ? Getting Values from appsettings.json : There are one or more ways available to fetch values from appsettings.json file in .NET Core. Following are the ways we are going to learn : Using IConfiguration : The IConfiguration is available in the dependency injection (DI) container, so you can directly access JSON properties by simply injecting IConfiguration in the constructor of a controller or class. It represents a set of key/value applic...