Tech Tutorials Database
GeekArticles Microsoft Microsoft.NET
 

Various ways of accessing DI services

 
Author: dotnetbips.com
Category: Microsoft.NET
Comments (0)

ASP.NET Core provides an inbuilt Dependency Injection framework that you can utilize to register and access services. One of my earlier article explains various lifetime options that you can use while registering a service. Once a service is registered with the DI container you can get an instance of the service using what is known as constructor injection. Although constructor injection is the most common way of accessing the registered services, there are a few more options that can be used to accomplish the task. To that end this article discusses these alternatives with a simple example.

Read More...




Sponsored Links




Read Next: HTML Input Placeholder Attribute



 

 

Comments



Post Your Comment:

Your Name:*
e-mail ID:(required for notification)*
Image Verification:�
 
 Subscribe