Questions tagged [ninject]
Ninject is a dependency injection framework for .NET applications. Use this tag for questions containing code that involves Ninject.
20
questions
9
votes
3
answers
849
views
Creating a round robin MySQL connection manager
Background
I am working on an e-commerce website, my web server is written in ASP.NET MVC (C#, EF6) and I am using 3 instances of MySQL DB. These DBs are in a cluster (Galera Cluster) and they are ...
2
votes
0
answers
1k
views
Ninject binding for Dbcontext
I have an asp.net web API and I am using EF6 to connect to a third party rest API which sells online game codes. We made a deal with the company so clients have to call my rest API in order to get the ...
1
vote
0
answers
379
views
Xamarin Forms with Ninject navigation service
I am new to Xamarin Forms and I have been searching online finding ways to set up navigation in a MVVM fashion. In particular I am designing around a concept I found here. However, I am using Ninject ...
12
votes
4
answers
597
views
Constructor-injecting a truckload of commands
There's a problem in Rubberduck that we haven't neatly solved yet, and as we're exploring alternative approaches I figured I'd ask the CR community and see what our C# experts think.
Here's the ...
13
votes
1
answer
11k
views
Unit of Work (UoW) pattern with ADO.NET
I'm trying to implement the UoW pattern using ADO.NET and this is what I've achieved so far:
The IUnitOfWork Interface:
...
5
votes
1
answer
3k
views
UnitTesting with Mocking and Dependency Injection using Ninject
I have the following scenario that I have not come across so far using Ninject. I have the following class structure (simplified for easy of reading :]). First the abstract base class for all ...
4
votes
2
answers
11k
views
Injectable logging with NLog and Ninject
I have been using NLog for logging purposes in my web applications, but it was not injectable. More precisely, each class using logging declared the logger like this:
...
3
votes
0
answers
1k
views
Tiny calculator using dependency injection and inversion of control
I've started to learn very interesting concept of DI, IoC and related stuff.
I have decided to learn it using simple application, very tiny calculator (only basic functions: add, subtract, multiply &...
3
votes
1
answer
7k
views
Use of Ninject as an IoC container in a WinForms MVC application
I am a relatively experienced WPF developer who has had good exposure to MVVM. I have been developing legacy WinForms applications for a while and have recently been asked to fully re-write a large ...
8
votes
1
answer
125
views
CommandBars, Buttons and Commands: Take 3
Following up on CommandBars, Buttons and Commands: Take 2, I've refactored quite a lot of the Rubberduck code base (like, a whole third of the entire code base has been affected), and successfully ...
3
votes
1
answer
453
views
N-tiered web app to save a role
My project manager is saying that there are many bad things in my code, but they are not helping me to correct it. Can you please specify the bad things they mean?
I have 7 projects in my solution ...
6
votes
2
answers
170
views
CommandBars, Buttons and Commands: Take 2
Following-up on CommandBars, Buttons and Commands: Cleanup is on the menu, I decided to try a more ambitious approach, as suggested in Nikita's answer. It works, but there are a number of "gotchas" ...
4
votes
1
answer
434
views
Unit testing a service to return items from a database
I have been a developer for many years and get core development concepts, as well as unit testing ones such as DI/Ioc, Mocking etc. I also understand the values, importance of unit testing and writing ...
11
votes
1
answer
1k
views
IoC Registration: Convention over Configuration
The rubberduck project has reached a turning point. The core features are implemented (except the SmartIndenter embedding - we're keeping that for 2.0), the next few releases will probably just build ...
3
votes
1
answer
482
views
Unit/integration tests
Here's what I got:
...
4
votes
1
answer
459
views
Properly using parameterized Factory.Create() method using DI
My factory is using method injection because I thought this was the best way to make it so far. Besides, I doubt it is a good thing after having to call on its ...
13
votes
2
answers
11k
views
Do I need ninject when implementing DAL with generic repository and unit of work?
I am implementing generic repository and unit of work for the first time. I would be glad if someone can correct me if I am doing something wrong here.
This is how I communicate with my DAL from ...
3
votes
1
answer
640
views
NinjectWebCommon implementation/translation - C# to F#
I've translated this code from c# and would like it to be more idiomatic f#:
...
11
votes
1
answer
2k
views
How can I solve my constructor injection code architecture?
The current code solves the issue I had when trying to use property injection.
Problem: Every module must use constructor injection because of a circular reference that occurs when not using ...
11
votes
1
answer
281
views
Having trouble with KISSing
There's a bit of a weird piece in my API that I'm not too happy about, but I can't seem to see any other way of going about.
It involves a IFunctionalityFactory ...