Questions tagged [ninject]
The ninject tag has no summary.
15 questions
1 vote
2 answers
208 views
Add behaviours without changing existing code
I have a data access layer, which currently communicates with a database. public interface IDao<T> // T is my DTO { Write(IEnumerable<T> dtosToPersist) } public class Dao<T> : ...
1 vote
1 answer
2k views
Manually disposing Entity Framework Context while using Ninject InRequestScope();
Spending some time sifting through documentation, I'm trying to figure out the best software architecture with or without the dispose pattern. I've built the Repository pattern many time over the ...
21 votes
7 answers
16k views
What is the "right" way to implement DI in .NET?
I'm looking to implement dependency injection in a relatively large application but have no experience in it. I studied the concept and a few implementations of IoC and dependency injectors available, ...
5 votes
4 answers
2k views
Does anyone have a good DI registration pattern?
I've done this so many times but I never end up liking how my code turns out. I'm asking if anyone else has the same problems and can offer solutions or conventions that they've used to make cleaner ...
0 votes
1 answer
409 views
What is a good practical example demonstrating an architectural advantage in interface dependency injection
I need help (preferably by way of a practical example) to understand why/if the following implementation of IoC/DI (in this case using Ninject) provides an architectural advantage: using (IKernel ...
0 votes
1 answer
178 views
How to apply IoC (or something similar) to a constant?
I have the following class with the following members: public class RegistrationPresenter : EPiPresenter<IRegistrationView, LoginPage>, IDisposable { private readonly static string[] ...
4 votes
1 answer
1k views
Configuring DI in a decoupled app
I'm reading through Mark Seeman's Dependency Injection in .NET (excellent read so far) and something is escaping me. If the application's architecture is like [DAL] => [BLL] <= [UI], with the ...
0 votes
1 answer
2k views
How to make Ninject inject an MVC view model?
How do I configure Ninject so it injects an instance in a view model? PS. It is an abstracted service to help with validation, so I am not trying to burden the model with too much responsibilities.