Given:
public interface IFeedOperations : IOperationsWithPreInstalledData
{
...
}
public class FeedOperations : IFeedOperations
{
}
How do I use RegisterType for a class that implements IFeedOperations AND therefore the IOperationsWithPreInstalledData as well?
public class FeedsInstaller : IDependencyInstaller
{
public void Install(IDependencyContainer container)
{
container.RegisterType(typeof(IFeedOperations), typeof(FeedOperations));
container.RegisterType(typeof(IOperationsWithPreInstalledData), typeof(FeedOperations));
}
}
The current code yields the following error. And if I remove the second RegisterType then I get no results when I call container.ResolveAll<IOperationsWithPreInstalledData>().
Component ...Feeds.FeedOperations could not be registered. There is already a component with that name. Did you want to modify the existing component instead? If not, make sure you specify a unique name.
And if I remove the second RegisterType then I get no results when I call container.ResolveAll<IOperationsWithPreInstalledData>(). Castle Windsor doesn't seem to see that a class implementing IFeedOperations also implements IOperationsWithPreInstalledData.
How can I register my implementing class with Castle Windsor so that it knows my class implements both interfaces -- or rather that either interface can be resolved by my class.
IDependencyContainerdoesn't seem to be any type from Castle. Is that your custom interface?