Use Enum as parameter in Windsor configuration file

how would I set the Windsor configuration file parameter with the specified Enum entry, such as "EntryType" below?

I currently have this:

<component
      id="test.service" service=".." type=".." lifestyle="transient">
      <parameters>
        <entryType>EntryType.Test</entryType>
      </parameters>
    </component>

Where .., obviously, represents the complete namespace and assembly.

But getting this error:

Could not convert from 'EntryType.Test' to 
   Business.Common.Services.Core.TestService+EntryType.
+3
source share
1 answer

Written in this way, it worked for me:

<component
  id="test.service" service=".." type=".." lifestyle="transient">
  <parameters>
    <entryType>Test</entryType><!-- NOT EntryType.Test -->
  </parameters>
</component>
+5
source

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


All Articles