NInject vs. StructureMap etc...
Does anyone have any good suggestions around IoC/DI frameworks? I'm looking into them a bit, but since IoC is new to me I'm looking for pointers on what to check out first. ...
Does anyone have any good suggestions around IoC/DI frameworks? I'm looking into them a bit, but since IoC is new to me I'm looking for pointers on what to check out first. ...
Hi I want to get started using Dependency Injection and IOC and I want to get more into using Ninject. Are there any good application with sourcecode available that is written using Ninject that I can look at as a reference? ...
I'm learning DI, and made my first project recently. In this project I've implement the repository pattern. I have the interfaces and the concrete implementations. I wonder if is possible to build the implementation of my interfaces as "plugins", dlls that my program will load dynamically. So the program could be improved over time wit...
problem description: This model works fine with one user at a time. As soon as I get multiple users at once, I get a serious of errors relating to not closing my SqlDataReader. When i turn off lazy loading like this: persistenceModel.Conventions.OneToManyConvention = (prop => prop.SetAttribute("lazy", "false")); It's fine, yet perfo...
I'm working with Ninject on a web application, using the BasePage and BaseMaster from the frameworks's integrations. What I would like to do is have an object injected and have a new instance created on each session. I've looked at the OnePerRequest behavior and it's close, but not quite. What I'm doing is performing a lot of calculati...
I have the following scenario. I have a ViewModel object (It's just a regular object, that impliments INotifyPropertyChanged). I'm binding this object to a view, written in WPF. When I bind it it works fine, events fire, and things are updated, perfect!!! Now I've tried to introduce some validation into the object, I'm checking argum...
does anyone know about an open source project Implementing Ninject Framework or another one, I haven't work with a DI framework before and Ninject calls my attention because you don't need to have your configuration in XML files. i tend to grasp a lot more when reviewing already implemented code. also if you know about another good p...
I am looking for a way to do something like this with Ninject : // Sample from the Unity application block IMyService result = myContainer.Resolve<IMyService>("Data"); ( from http://msdn.microsoft.com/en-us/library/cc440957.aspx ) Is it possible? ...
I've been using Ninject as my IOC in my web app. It's great and I think it works really well, however I have been trying to register some interfaces / classes as OnePerRequestBehaviour but it doesn't seem to actually use the behaviour. The code runs correctly but in one of my classes it lazy loads page information from the database then ...
I have some providers, say - <Providers> <Provider Type="Providers.IM" Name="Im"/> <Provider Type="Providers.Web" Name="Web"/> ... </Provider> Each of these providers can give me a session : <Sessions> <Session Name="GoogleIM" Provider="Im" URL="..." /> <Session Name="YahooIM" Provider="Im" URL="..." /> <S...
I'm using NInject on a new web application and there are two things that are unclear to me: Don't I need to keep a reference to the Kernel around (Session/App variable) to insure that GC doesn't collect all my instances? For example, if I specify .Using() and then the Kernel object gets collected, aren't all my "singletons" collected ...
I'd like to create a OnePerSessionBehavior for NInject (v1.0) and I've mostly got it working. The only issue that remains is how to pass in fresh arguments using .WithArguments() as each new session asks for something from the container. Right now I'm keeping a reference to the container as an application variable and therefore the mod...
I am using Ninject to load serveral modules. When two modules try to bind two different implementations for an interface, ninject raises an error that multiple binding for a service are not allowed. All other IoC frameworks I'm using (Unity, Windsor, Spring.net, etc) all have the ability to 'register' multiple implementations for an...
I'd like to declare a chain of responsibility using decorators in Ninject. Has anyone done that before? Thanks. ...
I want to use dependency injection in an medium trust environment. To that aim I picked Ninject as Iv been told its light weight. How do I set-up injection into the controllers? When I tried to create a custom controller factory: public class NinjectControllerFactory : DefaultControllerFactory { private readonly IKernel...
I've recently had to update a relatively large control library that uses Ninject 1.0 to Ninject 2.0 to help resolve some issues I had with 1.0. The update has gone well and I think Ninject 2.0 is a lot quicker. However to try and avoid this problem in the future I have created my own interface for injecting fields and properties (which ...
Suppose I have an interface for a service: public interface IFooService { void DoSomething(); } And a concrete implementation of that service that is a generic: public class FooService<TRequestingClass> : IFooService { public virtual void DoSomething() { } } And I have some other class that needs an instance of IFooService: ...
Hi all I have simple win service, that executes few tasks periodically. How should I pass Ninject kernel to all my task classes? Is it good idea to create static variable of base task class and initialize it on service start? ...
I'm new to IoC/DI frameworks. The first one I am trying is the Ninject framework. It seems straightforward, but I can't get my console application to run. I keep getting an ActivationException stating: "Error activating MainWindow: the StandardProvider returned an instance of type FutureRealisticDateManager, which is not compatible wit...
I am using the generic repository pattern to persist my data. On the PageLoad, I am creating a new Repository (from IRepository) object, and on PageUnload, I dispose of it. Should the MasterPage/Page be in charge of instantiating the objects to pass to the presenter or should the presenter be in charge of this? I'm more concerned wi...