Questions tagged [ninject-extensions]

Ninject Extensions are a collection of open-source projects designed to extend the functionality of the Ninject open-source dependency injector for the .NET framework.

Ninject Extensions are a collection of open-source projects designed to extend the functionality of the Ninject open-source dependency injector for the .NET framework.

Extension projects include, among others, those targeted at situations involving specific technologies such as MVC and WCF, as well as situations involving design patterns, such as Factories and Conventions.

207 questions
0
votes
2 answers

Ninject.Extensions.Factory with non-generic type parameter

I know I can bind the following generic interface with ToFactory method. public interface IFoo {} public interface IFooFactory { TFoo Create() where TFoo : IFoo; } ... kernel.Bind().ToFactory(); This code works as expected.…
Zoltán Tamási
  • 12,249
  • 8
  • 65
  • 93
0
votes
0 answers

Private variable is null with Ninject Interception after upgrading from 2.2 to 3.2

I upgraded Ninject from 2.2 to 3.2. Before, the interception worked fine, but now if I set a breakpoint I can see that the parameterless constructor is getting called after the constructor that has the parameters that Ninject is injecting. It wasn't…
adam0101
  • 29,096
  • 21
  • 96
  • 174
0
votes
1 answer

Controlling lifetime of objects created by factory generated by ToFactory()

I am using the following Ninject related nuget packages in an MVC 5 WebAPI application: Ninject.MVC5 Ninject.Extensions.Factory ninject.extensions.conventions I have a simple repository and a corresponding factory class like so: public interface…
Abhijeet Patel
  • 6,562
  • 8
  • 50
  • 93
0
votes
1 answer

Multiple Ninject Modules giving odd behaviour

This one is a little complex but reproducible in my environment. Architecture as follows; BindingsLayer +-NinjectBindingsModule +-NinjectWebBindingsModule ContractsLayer +- ISomeService +- IAnotherService DomainLayer +-…
DiskJunky
  • 4,750
  • 3
  • 37
  • 66
0
votes
1 answer

Ninject Factory Extension and Dealing with Memory Leak

This question is more of a "how do I do it?", rather than a "what am I doing wrong?". I have a class which is called QueryProcessor that processes queries (think CQRS). That object is injected into my presenters. The QueryProcessor needs to use the…
onefootswill
  • 3,707
  • 6
  • 47
  • 101
0
votes
1 answer

Ninject - Resolve instance per method call

I'm finding a solution to resolve an instance per method call. Something like that: public class ServiceAPI { public void ServiceAction() { //Call certain repository action // Ex: …
pham cuong
  • 849
  • 1
  • 12
  • 24
0
votes
1 answer

WCF. Set user credentials

Sorry, my english is bad. I have wcf services project and asp.net mvc project I'm using ninject wcf client extension to inject services like in this example Bind().ToServiceChannel(); Now i'm I need to add authentication and…
0
votes
2 answers

Iterating List in a Anonymous Type

I am using Ninject Interception extension to implement SQLLogging. I have a variable called 'param' and it is an Anonymous type as it showed in Watch window (See the picture below). When I do param.ToString() it returned {Countries =…
0
votes
1 answer

Send event from NLog target using AppccelerateEventBroker

I want to put log messages to console and part of UI of my app simultaneously. But i cant find a way to do it with ninject. I have a logger injected by ninject, and it perfectly make output to console and custom target. But I can't subscribe target…
daspisch
  • 13
  • 3
0
votes
2 answers

NInject: Create instances per user/session on convention binding

In summary: I've undefined of unknowed IProducerPlugin implementations on several assemblies located on a plugins folder. I've a Core object stores a list of current registered users. Core is Composition Root. So, I need: To create as many…
Jordi
  • 20,868
  • 39
  • 149
  • 333
0
votes
1 answer

NInject kernel GetAll returns empty

I've two projects (class library projects) which implement one interface: The first one: public class MailPlugin : Extensibility.IProductorPlugin { ... } The second one: public class FileSystemPlugin : Extensibility.IProductorPlugin { …
Jordi
  • 20,868
  • 39
  • 149
  • 333
0
votes
1 answer

Configure Ninject Factory to return the same instance every time

I have a service layer that I am reusing (AKA Business Layer). Here's an example of one of my services with an IMyContextFactory dependency, this returns an instance of IMyContext. public class MyService : IMyService { private IMyContextFactory…
Luke
  • 22,826
  • 31
  • 110
  • 193
0
votes
2 answers

inject - InSessionScope Extension problems with AppFabric Cache

Ninject doesn’t provide a InSessionScope Binding for Websites, so we have created our own extension: public static IBindingNamedWithOrOnSyntax InSessionScope(this IBindingInSyntax parent) { return…
squadwuschel
  • 3,328
  • 3
  • 34
  • 45
0
votes
1 answer

A registration already exists for uri

I am working on a Generic WCF Host that scans a plugins folder and loads all assemblies that implement a type "IWebService" I then use Ninject to start hosting the wcf service. All configurations are in the App.config. This works great when there…
Wjdavis5
  • 3,952
  • 7
  • 35
  • 63
0
votes
0 answers

How to use the `Ninject.Extensions.Factory` to dynamically generate factories for internals classes?

I need to use the Ninject.Extensions.Factory to generate the constructor of internal classes. Follow one example: using Ninject.Extensions.Conventions; using Ninject.Modules; using Ninject.Extensions.Factory; namespace ClassLibrary { using…
user1785721