Questions tagged [ninject]

Ninject is a dependency injection framework for .NET applications. Use this tag for questions containing code that involves Ninject.

Filter by
Sorted by
Tagged with
1
vote
0answers
46 views

Tightly coupled Basic Authentication Filter

I have an asp.net web api and I would like to use basic authentication. Is there any way to make this loosely coupled? I tried constructor DI but I couldn't figure it out how to pass Dbcontext into ...
2
votes
0answers
196 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
0answers
201 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
4answers
370 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 ...
1
vote
0answers
37 views

Display dropdowns with any database exception errors

I have just started a small MVC application wherein the first task is to display two dropdowns, one with Category and the other with Projects. I have to display the error messages in validation ...
1
vote
0answers
141 views

Generating Resource URLs in Multi-Layered Web API 2 Project

I am building a RESTful Api service in .NET. I have a requirement where I need to include resource URLs as part of JSON data returned from the endpoints of my API. The solution currently has the ...
11
votes
1answer
7k 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
1answer
2k 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 ...
3
votes
2answers
8k 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
0answers
696 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
1answer
6k 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
1answer
110 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
1answer
410 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
2answers
156 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" ...
3
votes
1answer
297 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
1answer
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
1answer
435 views

Unit/integration tests

Here's what I got: ...
4
votes
1answer
284 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
2answers
10k 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
1answer
609 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
1answer
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
1answer
269 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 ...