So I currently have a master DAO class ITrackingToolDAO that has all the Service Contracts for each of my business entities.
public partial interface ITrackingToolDAO {
void Open(string connectionString);
void Close();
IBusinessFunctionDAO BusinessFunction { get; }
IBusinessUnitDAO BusinessUnit { get; }
IProgramBudg...
When using the ArrayResolver, if I register multiple implementations of an interface and a class that depends on an array of said interfaces, I expect the array resolver to inject all the interface implementations that can be successfully resolved. If a registered implementation of that interface cannot be resolved, it will not be injec...
I have an interface
public interface IResolver<T>
{
T Resolve();
}
I know this isn't the ideal (service locator is an anti-pattern and all), but in some cases it's still necessary (for example WCF service activation - I don't want to instantiate the channel until Resolve() is explicitly called...and in the case of BasicHTTP, the ...
I looked at this and it answers half my questions:
http://stackoverflow.com/questions/2370546/castle-windsor-register-class-with-internal-constructor
But can you use Windsor to use internal constructors/class along with dependency injection? (so constructor parameters get injected too)? I'd like to keep the class/constructor internal t...
I have some (sort of) Singletons which exist in three context:
Per AppDomain
Per HttpApplication
Per Web Request
Right now, I'm creating a child container per HttpApplication and another child per Web Request. This is necessary because some components SHOULD actually share singleton instances across the three layers. For security and...
When using the ArrayResolver, if I register multiple dependencies that implement the same interface and I have registered classes that depend on an array of these dependencies, one would expect ServiceOverrides to be respected and allow control over which dependencies are injected into the contructors. Instead, I have seen and written te...
Hello all,
The short question:
Does Castle Windsor have something similar to Spring.Net's "Lookup Method Injection" that can be configured from XML, which provides the ability to fetch transient instances from the container without the class being aware of the IoC container?
The long question:
I'm a long time Spring/Spring.Net user and...
I use DependsOn for static dependencies such as connection strings. What is the equivalent function for Unity's Fluent interface?
...
So I've been working hard for a while to build a solution which creates certain components using nothing but Castle DynamicProxy (version 2.2) and an interceptor. Everything looks great except that at the end of all this I realized I need to register these components with the windsor container. Is this possible or has my work been for na...
I have a Windsor container that I'm using an InterceptorSelector and a LazyComponentLoader with.
My InterceptorSelector returns an InterceptorReference to my InterceptorAdapter class that looks like this
public class InterceptorAdapter<T> : Castle.DynamicProxy.IInterceptor, IOnBehalfAware where T : IMyType
{
private readonly T int...
Hi I was thinking about such case:
public class MyService {
private IList<Entity> data;
public virtual IList<Entity> GetData()
{
return data;
}
public virtual IList<Entity> GetDataAdvanced()
{
return GetData();
}
}
Consider a situation when i...
After reading the documentation (http://stw.castleproject.org/Windsor.Installers.ashx) I've found a strange part:
Although technically it's OK to call Install multiple times, or register components outside of installers it is considered good practice to encapsulate all registration in installers, and to install all installers during ...
I have a WindsorContainer with a IModelInterceptorsSelector. It works well except for component's that have no implementation (eg. have all behavior handled dynamically by an IInterceptor).
If I try to resolve a component with an interface only, I get:
Castle.MicroKernel.ComponentActivator.ComponentActivatorException occurred
Message...
Based on the documentation for Castle.Core.InterceptorAttribute, I am trying to make this simple test pass, and am having no luck:
using NUnit.Framework;
using Castle.DynamicProxy;
using Castle.Core;
using Castle.MicroKernel;
using Castle.MicroKernel.Registration;
public interface IIntercepted { string get(); }
[Interceptor(typeof(Te...