Windsor lock: how to use type property as constructor in xml config?

I have the following:
  TypeUser: ITypeUser
  {
      public TypeUser (Type usedType) {..}
  }

How to configure the "Type" parameter in the xsws windsor configurator?

+3
source share
1 answer

For custom types, you need to provide a type converter to handle the conversion, however the “Type” is supported out of the box (if you look at it here on the Castleproject website ) and should “just work”, i.e. So:

<component id="myServer" service="SomeNameSpace.ITypeUser, SomeAssembly" type="SomeNameSpace.TypeUser, SomeLib">
    <parameters>
        <usedType>SomeNameSpace.MyOtherType, SomeAssembly</usedType>
    </parameters>
</component>
+3
source

Source: https://habr.com/ru/post/1698395/


All Articles