tagged [inversion-of-control]
How to use Autofac in a class library project?
How to use Autofac in a class library project? I have the following implementation: This service is in a separate project than that of my web project. Where and how would I specify the dependency inje...
- Modified
- 1 Feb at 12:59
What is a JavaBean exactly?
What is a JavaBean exactly? I understood, I think, that a "Bean" is a Java-class with properties and getters/setters. As much as I understand, it is the equivalent of a C `struct`. Is that true? Also,...
- Modified
- 12 Oct at 12:25
Examples of IoC Containers
Examples of IoC Containers Does anyone have good examples of IoC containers (preferably in c#) and how and why to use them ? I have checked out the [wiki page](http://en.wikipedia.org/wiki/Inversion_o...
- Modified
- 20 Apr at 20:51
Asp.Net Core: register implementation with multiple interfaces and lifestyle Singleton
Asp.Net Core: register implementation with multiple interfaces and lifestyle Singleton Considering the following interface and class definitions: is there any way to register one instance of `MyClass`...
- Modified
- 26 Jan at 15:30
Generic Type in constructor
Generic Type in constructor I have a Generic Type Interface and want a constructor of an object to take in the Generic Interface. Like: I want the code that creates this object to specify the IGeneric...
- Modified
- 31 Mar at 14:2
IoC in class library. Where to bootstrap
IoC in class library. Where to bootstrap I'm using a class library that can be reused by other components. In this class library I'm using unity for dependency injection. For this class library I crea...
- Modified
- 17 Apr at 12:58
When would you use the Common Service Locator?
When would you use the Common Service Locator? I've been looking at the [Common Service Locator](http://commonservicelocator.codeplex.com/) as a way of abstracting my IoC container but I've been notic...
- Modified
- 18 May at 02:56
How to avoid Dependency Injection constructor madness?
How to avoid Dependency Injection constructor madness? I find that my constructors are starting to look like this: with ever increasing parameter list. Since "Container" is my dependency injection con...
- Modified
- 11 Mar at 15:24
Way to fill collection with Unity
Way to fill collection with Unity I have two example classes and I need to resolve ClassToResolve ``` var classToResolve = new ClassToResolve( new List()
- Modified
- 10 Jun at 09:19
How to inject dependency property using Ioc Unity
How to inject dependency property using Ioc Unity I have the following classes: ``` public interface IServiceA { string MethodA1(); } public interface IServiceB { string MethodB1(); } public class...
- Modified
- 7 Dec at 13:2
Auto-register all interfaces with Unity
Auto-register all interfaces with Unity Using Unity, I'd like to automatically register all interface/class combinations in an assembly based on the following convention: StructureMap does that when t...
- Modified
- 14 Mar at 12:42
Access serviceStack session inside AppHost to get userId for ioc injection for selfHosted app
Access serviceStack session inside AppHost to get userId for ioc injection for selfHosted app I need to pass the userId to my dataAccess classes for auditing purposes and I am trying to inject it into...
- Modified
- 29 Oct at 13:44
Is this a good example of the "Bastard injection anti-pattern"?
Is this a good example of the "Bastard injection anti-pattern"? I see lead developers writing code like this and upon reading Mark Seemann's book I'm wondering if the specific "new" is "foreign", thus...
- Modified
- 13 Oct at 16:33
Autofac Scanning Assemblies for certain class type
Autofac Scanning Assemblies for certain class type I've started using `Autofac` and want to scan some DLL's and get `Autofac` to register some of the classes within them. The classes that I'm interest...
- Modified
- 19 May at 04:11
What is Castle Windsor, and why should I care?
What is Castle Windsor, and why should I care? I'm a long-time Windows developer, having cut my teeth on win32 and early COM. I've been working with .NET since 2001, so I'm pretty fluent in C# and the...
- Modified
- 4 Mar at 10:1
ServiceStack IoC Dependencies within dependencies
ServiceStack IoC Dependencies within dependencies I have an object that inherits from an Interface I have registered it in my apphost When I go to use the DbConnectionFactory in the Calcu
- Modified
- 15 Nov at 22:21
How to configure unity container to provide string constructor value?
How to configure unity container to provide string constructor value? This is my `dad` class This is my test method ``` public void TestDad() { UnityContainer DadContainer= new UnityContainer...
- Modified
- 30 Jun at 14:1
ServiceStack, how to access business logic Pocos?
ServiceStack, how to access business logic Pocos? Given the following service class in ServiceStack, how would I access `someOtherClassInstance`? I am puzzled about what best practices are to return o...
- Modified
- 28 May at 08:13
ServiceStack - injecting Properties
ServiceStack - injecting Properties I am getting very confused with the Funq container. I have the following: ``` public interface IConnectionString { string ConnectionString { get; set; } } public ...
- Modified
- 9 Oct at 13:15
What do programmers mean when they say, "Code against an interface, not an object."?
What do programmers mean when they say, "Code against an interface, not an object."? I've started the very long and arduous quest to learn and TDD to my workflow. I'm under the impression that TDD fit...
- Modified
- 3 Sep at 16:10
Inversion of Control & Dependency Injection in the .NET Framework
Inversion of Control & Dependency Injection in the .NET Framework Is there any specific example/instance of DI being applied as an architectural principle or design pattern ? Do any (or many) of the t...
- Modified
- 29 Jul at 15:9
IoC (Ninject) and Factories
IoC (Ninject) and Factories If I have the following code: ``` public class RobotNavigationService : IRobotNavigationService { public RobotNavigationService(IRobotFactory robotFactory) { //... } } ...
- Modified
- 23 Apr at 18:37
Is Func<in T, out TResult> appropriate to use as a ctor arg when applying Dependency Injection?
Is Func appropriate to use as a ctor arg when applying Dependency Injection? Example: ``` public class BusinessTransactionFactory where T : IBusinessTransaction { readonly Func _createTransaction; ...
- Modified
- 28 Nov at 19:18
Resolving from ServiceStack's IoC container which depends on another registered element
Resolving from ServiceStack's IoC container which depends on another registered element I have a class which should have an instance of a `Service` (to access the database and other services): I want ...
- Modified
- 15 Sep at 10:11
Remove Dependency on IoC Container
Remove Dependency on IoC Container After reading more and more about IoC containers, I read [this post](https://stackoverflow.com/questions/109668/ioc-where-do-you-put-the-container/152362#152362) abo...
- Modified
- 23 May at 11:51