Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Depth implementation of DI in Asp.net Core

$
0
0

Hi,

I am new to Asp.net Core, and I know that we could configure custom log in Asp.net Core, but I do not why it works. Normally, we use new key words to initialize a class and then use it in the controller. In asp.net core, we use controller with parameter like below:

    public class HomeController : Controller
    {
        private readonly ILogger _logger;
        public HomeController(ILogger<HomeController> logger)
        {
            _logger = logger;
        }

I know it is a design Patten called Dependence Injection, but I am wondering depth implementation of this.

How did it achieve in Asp.net Core?

Best Regards,

Tony


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>