ninject Questions

1

Solved

Can anyone tell me if i can register an already created instance of a class with Ninject so that it will use this instance everytime it needs injecting? I suppose you can call it a singleton but I...
Inapproachable asked 4/6, 2013 at 11:2

1

Solved

i have the following interfaces injected in Castle Windsor. how do i do the same in Ninject? container.Register( AllTypes.FromAssemblyNamed("Apps.Web") .BasedOn(typeof(ICommandHandler<>)) ...
Cavalryman asked 3/6, 2013 at 12:17

3

Solved

In my MVC3 project I've setup my kernel to Ninject the Entityframework context on a InRequestScope basis, this works perfect. But I have a background runner that does some workflow management. It ...
Burin asked 31/10, 2011 at 9:35

2

Solved

I am writing a Windows Service that (if all goes according to plan) will run for months at a time. Throughout the lifetime of the service, it will maintain several WCF services (named pipes for com...
Stripe asked 18/5, 2013 at 15:3

5

Solved

We are using ASP.net MVC. Which of these is the best DI framework Ninject or Unity and why?
Bryant asked 28/6, 2009 at 12:8

2

Solved

I'm using Ninject and the extensions EventBroker and DependencyCreation in an MVC 3 application. I've installed and am using the Ninject.MVC3 package and therefore the OnePerRequestModule. I'm att...

2

Resolving a class that has multiple constructors with NInject doesn't seem to work. public class Class1 : IClass { public Class1(int param) {...} public Class1(int param2, string param3) { .. } } ...
Phylys asked 26/3, 2010 at 9:42

2

Solved

I am at a loss of what to do with the multitude of documentation available through google in .net as regards using Ninject with asp.net mvc 4 First of all, i want to know if Controller factories a...
Flitter asked 11/3, 2013 at 8:19

2

Solved

I really would like to use SharpRepository together with Ninject, but I do not understand how to configure Ninject to share the Entity Framework DbContext between the repositories. I am using Enti...
Siegel asked 23/4, 2013 at 14:48

2

Solved

To start I'm using Ninject 1.5. I have two projects: Web project and a Class library. My DI configuration is within the Web project. Within my class library I have the following defined: public i...
Forwent asked 30/10, 2009 at 17:18

1

I'm rolling over my AutoMappers from using one large AutoMapperConfiguration class to using actual profiles. Global now looks like so (forgive the Open/Close violation for now) Mapper.Initialize(x...
Fleabag asked 22/4, 2013 at 17:55

2

Solved

I'm trying to use a custom role provider in an MVC3 app. I've already got the membership provider working ok using Ninject but can't seem to get the role provider working. The Membership provider d...
Kloster asked 29/6, 2011 at 11:14

1

Solved

Hope this is not a dumb question. I've been searching for two days a way to mock calls for system.web.security.roles on my actions. I want my unit tests to be isolated and not involve calls to ex...
Domesticate asked 11/3, 2013 at 3:15

2

Solved

Having deployed my website to IIS7.5 I found one strange behaviour: when application pool identity is left to be ApplicationPoolIdentity by default (as recommended in IIS Application Pool Identitie...
Enidenigma asked 28/3, 2013 at 8:26

2

Solved

On my service layer I have injected an UnitOfWork and 2 repositories in the constructor. The Unit of Work and repository have an instance of a DbContext I want to share between the two of them. How...
Capillaceous asked 24/3, 2013 at 13:56

1

Solved

I'm using Ninject for DI and the Ninject.MVC3 extension within an MVC4 app, specifically version 3.0.0.6. Reading the documentation on Ninject's wiki, it appears that the lifetime of objects creat...
Taking asked 3/4, 2013 at 3:22

1

Solved

In my NinjectWebCommon.cs file, under CreateKernel method I am applying the injection like this private static IKernel CreateKernel() { var kernel = new StandardKernel(); kernel.Bind<Func&lt...
Fossette asked 5/2, 2013 at 11:31

2

Solved

Any good examples of using Ninject with a Windows Service? I'm not sure what if any extensions I need. Also, not sure what the Composition Root should be? Any good examples of using Ninject with a ...
Paget asked 23/4, 2012 at 18:34

2

Solved

This code was generated for me after added entity framework code-first for SQL Server CE using NuGet. They did no changes to any other file. The file SQLCEEntityFramework.cs was created and placed ...
Sampler asked 28/4, 2011 at 1:28

1

Solved

So I am using a simple repository pattern with Attributes and Filters as recommended here since I am using the Ninject.Web.WebApi-RC package from NuGet. This works for the first request but since ...
Jennajenne asked 11/3, 2013 at 21:30

2

Solved

I am working on a project with MVC4, and have decided that I wish to add some dependency injection via Ninject. After download/install via NuGet, I find this error in the NinjectWebCommon.cs (Line ...
Wagers asked 29/5, 2012 at 13:56

2

Solved

I have an interface class: public interface IStartUpTask { bool IsEnabled { get; } void Configure(); } I have multimple classes implementing the same interface One of the classes looks like t...
Dropsy asked 8/3, 2013 at 9:10

1

Solved

I'm using a factory to return a datasender: Bind<IDataSenderFactory>() .ToFactory(); public interface IDataSenderFactory { IDataSender CreateDataSender(Connection connection); } I have ...
Munch asked 7/3, 2013 at 9:25

3

Solved

Imagine I have the following classes and interfaces: public interface IService<T> { } public class DefaultService<T> : IService<T> { } public class FooService : IService<Foo...
Lousy asked 20/5, 2011 at 1:49

2

I've been having a very difficult time finding an easy to follow tutorial or example of using the interception extension with Ninject, or ideally, a working example. I've tried the below tut...
Distributor asked 16/2, 2011 at 22:3

© 2022 - 2024 — McMap. All rights reserved.