Click here to Skip to main content
15,867,771 members
Everything / DI

DI

DI

Great Reads

by Akhil Mittal
A tutorial to learn dependency injection with the help of a simple example
by Dilip Nandakumar
Using Dependency Injection to manage navigation and assigning data context in MVVM design.
by Jason Sultana
How to add DI to your .NET console apps
by ASP.NET Community
Dear Friends,Dependency injection is the buzz word in asp.net world. There are lots of frameworks available today like Sprint.Net , Unity Framework

Latest Articles

by Daan Acohen
Simplify and resolve circular dependencies in .NET using the SmartInject NuGet package
by Jason Sultana
How to add DI to your .NET console apps
by Matthew Dennis
Munq IOC Container Version 3 has been released on CodePlex and as a NuGet package. This article demonstrates how to integrate the IOC Container into an ASP.NET MVC3 project.
by Rahul Rajat Singh
In this article we will look at how Dependency Injection works in ASP.NET Core.

All Articles

Sort by Score

DI 

13 Mar 2018 by Akhil Mittal
A tutorial to learn dependency injection with the help of a simple example
26 May 2016 by Dilip Nandakumar
Using Dependency Injection to manage navigation and assigning data context in MVVM design.
12 May 2012 by Wendelius
The constructor is used to set the private variable which isn't visible outside the class. Valid scope for the parameter obj is only the constructor. Yes, after succesfully calling the constructor the private field should contain the same object.
17 Jan 2016 by OriginalGriff
This is one of the most common problems we get asked, and it's also the one we are least equipped to answer, but you are most equipped to answer yourself.Let me just explain what the error means: You have tried to use a variable, property, or a method return value but it contains null -...
7 Aug 2022 by Jason Sultana
How to add DI to your .NET console apps
17 Jan 2012 by Le_Bedel
Hi, may someone help me. I am building an ASP.NET MVC App. But I decide to use DDD pattern. As DI Container I am using Castle Winsor. But When I run the test using NUnit test, I have the following error/* Test.RepositoriesTest.PostRepositoryTest.Get_All_Posts:SetUp :...
11 Oct 2013 by ASP.NET Community
Dear Friends,Dependency injection is the buzz word in asp.net world. There are lots of frameworks available today like Sprint.Net , Unity Framework
28 Feb 2014 by L. Michael
Using Abstractions to Ensure Low Coupling – DI Part 2
7 Oct 2014 by Praveen Dselva
I have A Interfacepublic interface ICountryDataService { void CountryDataService_Save(ICountry country); }And implement in a Classclass CountryDataService : DataServiceBase, ICountryDataService { public CountryDataService() { } ...
3 Dec 2015 by prasadnair44@gmail.com
I'm using Generic Repository to interact with Database(I'm using EF6.0)I'm using two Databases.Ninject has been using to implement DI.Sample code snippet below.1. Generic Repository/// Genertic Repository absract class with class and context /// ///
7 Dec 2015 by prasadnair44@gmail.com
thanks for your support. Resolved the issue using Contextual Binding in Ninject
17 Jan 2016 by Member 11470311
How Property Injection works in Caliburn Micro. Here is my Bootstrapperpublic class AppBootstrapper : BootstrapperBase { SimpleContainer container; public AppBootstrapper() { Initialize(); } protected override void...
17 Jan 2016 by Sergey Alexandrovich Kryukov
You did not show where the exception with the message "Object reference not set to an instance of an object" is thrown. Not to worry. This is one of the very easiest cases to detect and fix. It simply means that some member/variable of some reference type is dereferences by using and of its...
24 Aug 2016 by OriginalGriff
We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.And working out what you need to do...
11 Nov 2019 by khaleelsyed
We have created web api using .net core . but i am not sure when to use addscoped vs transient while setting up DI in startup class. Can any one explain me the scenarios for using addscoped vs transient?? Thank you in advance.. What I have tried: tried searching for the definition and usage...
11 Nov 2019 by Maciej Los
Please, read this: c# - AddTransient, AddScoped and AddSingleton Services Differences? - Stack Overflow[^]
18 Aug 2018 by Jitendra Selvam
This article is on how to upload and retrieve images from your .NET core 2.1 API.
17 Oct 2016 by Hasibul Haque
Description of DIP, IoC, DI, IoC container and how to use them in real life work
24 Sep 2019 by Matthew Dennis
Munq IOC Container Version 3 has been released on CodePlex and as a NuGet package. This article demonstrates how to integrate the IOC Container into an ASP.NET MVC3 project.
14 Jul 2015 by Shivprasad koirala
In this article we will learn C# Design pattern and Architecture pattern Step by Step with a project.
8 Oct 2015 by mvastarelli
How to override Castle Windsor's default behavior and make properties into required dependencies.
1 Jun 2015 by Mostafa Asaduzzaman
How to access files within the application using DI
24 Oct 2013 by Artem Elkin
Thoughts of how implementation inheritance violates Dependency Injection and Dependency Inversion principles.
17 Dec 2013 by Monjurul Habib
ASP.NET Web API is a framework for building and consuming HTTP services that can reach a broad range of clients including browsers, phones, and tablets.
31 Dec 2013 by Shivprasad koirala
Dependency Injection (DI) vs. Inversion of Control (IOC).
8 Feb 2017 by Rasik Bihari Tiwari
Let's understand exactly what is Dependency Inversion principle and what it is not. How people confuse it to be dependency injection which is it NOT.
18 Sep 2013 by Houssem_Dellai
Using Unity container instead of SimpleIoc in MVVM Light
29 Nov 2013 by Jeff Vanzella
Injecting servers, buckets and passwords into CouchbaseClient
16 Aug 2016 by Olubisi Akintunde
Application Managed Authorisation using Dependency Injection and Interception
26 Jul 2016 by santosh.yadav198613
Dependency injection
5 Nov 2012 by Mario Majčica
I found Seemann's post on DI and WebAPI:http://blog.ploeh.dk/2012/10/03/DependencyInjectionInASPNETWebAPIWithCastleWindsor.aspx[^]Once adapted to use Unity instead of CW, I made it work.This is my implementation:public class UnityCompositionRoot : IHttpControllerActivator{ ...
10 Nov 2017 by Vijay Gill
Uses Unity for DI and NLog for logging
4 Oct 2018 by Rahul Rajat Singh
In this article we will look at how Dependency Injection works in ASP.NET Core.
12 May 2012 by Ali_100
Design pattern – Inversion of control and Dependency injection[^]I am sorry if it is silly questionin the constructor methodology paragraph ...there is public class clscustomer{ private Iaddress _address; public clscustomer(Iaddress obj); { _address=obj; ...
3 Oct 2023 by Daan Acohen
Simplify and resolve circular dependencies in .NET using the SmartInject NuGet package
4 Nov 2012 by Mario Majčica
Dear all,I'm new to MVC and I got stuck on a problem. All the examples I managed to find refer to simple controllers and not to API controllers. Perhaps any one has a working code example on how to, on Application_Start(), register the dependencies to Unity and tweak the code so that once my...