ninject Questions

2

Solved

Our company has the need to log certain things each time one of our action methods of our ASP.NET WebApi controllers gets called. Since we use Ninject for the DI right now, we'd like to use it also...

2

Solved

I'm trying to create a Windows service with OWIN self hosted WebAPI with Ninject . I got it to work but I had to add a reference to system.web, which seems wrong. Without a reference to system.web ...
Pigg asked 5/9, 2014 at 15:13

2

Solved

I have been very happily using Ninject for a long time now, and I really like it, but I am faced with a difficult choice since the release of ASP.NET Core and MVC Core. Basically, out of the gate, ...
Ordinate asked 25/9, 2015 at 18:39

2

I'm having something like this: class Root { public Root(IDependency dep) {} } class Dependency:IDependency { public Dependency(int val) {} } And I'm trying to obtain a reference to Root u...
Octans asked 28/1, 2010 at 10:30

2

Solved

I'm using NInject to resolve the dependency for my first WPF application. Following are my code snippets. My App.xaml.cs goes like. public partial class App : Application { private IKernel conta...
Divot asked 13/9, 2015 at 9:41

1

Solved

(This question was first asked in the Ninject Google Group, but I see now that Stackoverflow seems to be more active.) I'm using the NamedScopeExtension to inject the same ViewModel into both the ...
Danit asked 20/8, 2015 at 9:15

4

Solved

I am new to Repository and DI and trying to implement in my MVC 5 project. I implemented Constructor Injection where in my controller has a constructor like this: IBook _ibook; public Test(IBook ...

3

Solved

Using the Ninject Factory extension, you can automatically generate factories, and let the factory pass parameters to the class' constructor. The following test passes: public interface IBar { in...
Anterior asked 27/6, 2012 at 10:54

2

Solved

I have inherited a Windows service where all the dependencies are created when the service starts and are injected in the transient scope. We are having a number of problems with this service, not...
Pestiferous asked 10/2, 2014 at 10:27

2

In Ninject I can get object needed for interface by using class WebContainerManager Ninject definition: var logManager = new LogManagerAdapter(); container.Bind<ILogManager>().ToConstant...
Longlegged asked 14/7, 2015 at 11:0

2

Solved

I created a binding for HttpContextBase in my NinjectWebCommon.RegisterServices method, but when I try to reference it in my controllers or services I get an error message. Here's the binding: ke...
Ethiopian asked 6/6, 2013 at 12:57

7

Solved

I use Ninject as a DI Container in my application. In order to loosely couple to my logging library, I use an interface like this: public interface ILogger { void Debug(string message); void De...
Lorraine asked 21/7, 2011 at 19:13

2

Solved

Arrrgh! I am pulling my hair over here. I have been trying to use IoC containers for a little bit, and all seems fine and dandy until you hit some issue that you think would be very basic, like pas...
Tierney asked 10/7, 2015 at 15:2

2

Solved

I am building a rest API with Web API2, Owin 3 and NInject Owinhost for my DI. Using the example provided by NInject, by which I create an "HttpConfiguration" object and call the NInject extension...
Fritzfritze asked 17/2, 2015 at 20:25

3

Solved

I am starting to use Ninject in my MVC5 code-first app. Here's my NinjectWebCommon.cs: private static IKernel CreateKernel() { var kernel = new StandardKernel(); try { kernel.Bind<Func<...
Arquit asked 24/6, 2015 at 13:19

1

I have an MVC 5 application which uses Ninject and I am adding Hangfire to it. When I have added Ninject, I have used the NinjectWebCommon nuget package because of its simplicity in the configurat...
Eley asked 16/6, 2015 at 0:21

3

Okay, so we have a development infrastructure that utilizes the following: 1. MVC 4 (Razor views) 2. Entity Framework 5 code first 3. Ninject What I'm looking for are eCommerce solutions tha...
Anaphase asked 15/1, 2013 at 16:10

2

Solved

I'm writing a small framework that executed a couple of tasks. Some om the tasks needs specific properties which are injected through Ninject. Let's say that I have the following constructor in my...
Alula asked 29/5, 2015 at 10:45

3

Solved

I have an ASP.NET MVC app with SignalR and WebAPI. The app uses Ninject for dependency injection, but apparently SignalR and WebAPI are getting different kernels, so it fails to share a singleton o...

2

Solved

I have a custom DataAnnotationsModelValidatorProvider for doing model validation in a more dynamic way then just adding attributes. I tried to add my provide to the global.asax.cs like so: ModelVa...
Psilocybin asked 2/12, 2011 at 13:11

4

Solved

I have for instance 2 interfases IInterface1 and IInterface2, public interface IInterface1 {...} public interface IInterface2 {...} and one implementation of these interfaces ImplClass. publi...
Turfy asked 16/11, 2010 at 14:53

1

Solved

I'm trying to set up dependency injection in a new WPF project using the framework Caliburn Micro and Ninject. Unfortunately I'm not succeeding :( There are a few examples on the internet which imp...
Nicety asked 16/3, 2015 at 11:22

2

Solved

I have an IConfig object that contains settings used throughout my application. At the moment, I inject the entire object into the constructor of each object that needs it, as follows: public inte...
Atlanta asked 18/5, 2012 at 8:30

3

Solved

Giving the default implementation of Domain Events: Interface that represents an domain event: public interface IDomainEvent { } Interface that represents a generic domain event handler: publi...
Lien asked 10/3, 2015 at 16:43

2

Solved

I'm attempting to ninject ApiControllers in an Azure worker role. I've previously accomplished ninjection with the same controllers in an asp.net mvc 5 / web api 2 project in the same solution. Ano...
Joscelin asked 12/4, 2014 at 16:46

© 2022 - 2024 — McMap. All rights reserved.