Search code examples
xmlparametersconstructorcastle-windsorcastle

How to pass an object to the constructor through castle windsor?


I am building an object through castle windsor and my constructor accepts an argument of a custom type. How do I pass it to my object.

public class ArgumentClass
{
   int value1;
   string value2;
}

public interface IInterface
{
}

public class CClass : IInterface
{
   public CClass(ArgumentClass arg) { }
}

All my configuration is defined in the XML file and I want to define the argument in the XML as well. So no programming please!


Solution

  • I don't know what I was thinking when I posted this question. Actually I was looking to pass a list of objects to a constructor. I ended up doing it like this:

    ${id1} ${id2} ${id3} ${id4}