views:

84

answers:

1

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?

+1  A: 

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

Erich Eichinger