====================== **collection** element ====================== Collection element is used to specify collection values. Based on the context, in which **collection** element is used, it might use **collectionType** and **itemType** attributes to specify collection type and collection items type, or these values will be derived by **IoC.Configuration**. .. note:: The possible values of **collectionType** attribute currently are **enumerable**, **list**, **readOnlyList**, and **array**. For example, if **collection** is used to specified as a constructor parameter, or injected property value, **collectionType** and **itemType** attributes are required, along with the **name** attribute. On the other hand, if **collection** is used to provide a return value in **autoProperty** or **autoMethod** elements, this attributes are not used, and **IoC.Configuration** determines the type of the collection from the auto-generated property or method return type. .. note:: Refer to :doc:`../../sample-files/IoCConfiguration_collection.generated` for more examples on **collection** element. Example 1: Using **collection** element to specify constructed parameter value in service implementation ======================================================================================================== .. code-block:: xml :linenos: Example 2: Using **collection** element to specify injected property value ========================================================================== .. code-block:: xml :linenos: Example 3: Using **collection** element to specify a returned value for auto-generated method ============================================================================================= .. code-block:: xml :linenos: Example 4: Using **collection** element to provide a service implementation =========================================================================== .. code-block:: xml :linenos: