Sunday, May 1, 2011

Contextual Binding with Spring.net

In other IoC containers like ninject you can setup contextual binding pretty easily. I was wondering if contextual binding was supported by the Spring.net IoC container?

From stackoverflow
  • You can easily use Spring Expressions to do contextual binding. Instead of

    <object name="myotherobject" ... />
    
    <object name="thisobject">
      <property name="TheService" ref="myotherobject" />
    

    you may write

    <property name="TheService" expr="<whatever spring expression you like>" />
    

    cheers, Erich

0 comments:

Post a Comment