zcz527 / autofac

Automatically exported from code.google.com/p/autofac
Other
0 stars 0 forks source link

Expansions for collections in the XML configuration #319

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I have noticed that collections of values in the XML configuration are not 
currently supported.

I have cloned the source and added in these features 
http://code.google.com/r/nicaog-autofac/ This will allow for properties and 
parameters that are IEnumerable, IEnumerable<T>, ICollection, ICollection<T>, 
IList, IList<T>, IDictionary, IDictionary<TKey, TValue> to be configured in 
xml. Conversion will be attempted for generic collections whose type parameters 
are not strings. Here is a brief syntax example.

  <component type="POCO">
    <properties>
      <property name="List">
        <list>
          <item value="Val1"/>
          <item value="Val2"/>
        </list>
      </property>
    </properties>
  </component>

  <component type="POCO">
    <properties>
      <property name="Dictionary">
        <dictionary>
          <item key="1" value="Val1"/>
          <item key="2" value="Val2"/>
        </dictionary>
      </property>
    </properties>
  </component>

I would appreciate if these features could be reviewed for inclusion into the 
trunk.

I would be happy to help update the wiki, or provide a patch file.

Original issue reported on code.google.com by nic...@gmail.com on 13 Apr 2011 at 9:34

GoogleCodeExporter commented 8 years ago
Thanks very much for following up. The changes look good, and the offer of help 
with the Wiki is much appreciated. I'll be able to look at this in a week or so 
and will update you then.

Original comment by nicholas...@gmail.com on 17 Apr 2011 at 4:05

GoogleCodeExporter commented 8 years ago
Finally got this in - great patch, thanks! Will be published in release 2.5.

Original comment by nicholas...@gmail.com on 3 Jul 2011 at 12:42