parameterValue element
Element parameterValue is used to reference a parameter value in auto-implemented method of auto-generated service.
This element can be used only under elements if or default under element autoMethod.
Note
Refer to Autogenerated Services for more details on auto-generated services.
The element uses an attribute paramName to reference the parameter of auto-generated method. A parameter with this name should be declared under element ../autoService/autoMethod/methodSignature.
An example below demonstrated an example of using an element parameterValue.
1<autoGeneratedServices>
2 <!--Demo of referencing auto-implemented method parameters using
3 parameterValue element-->
4 <autoService
5 interface="IoC.Configuration.Tests.AutoService.Services.IAppInfoFactory">
6
7 <autoMethod name="CreateAppInfo"
8 returnType="IoC.Configuration.Tests.AutoService.Services.IAppInfo">
9 <methodSignature>
10 <int32 paramName="appId"/>
11 <string paramName="appDescription"/>
12 </methodSignature>
13
14 <default>
15 <constructedValue
16 type="IoC.Configuration.Tests.AutoService.Services.AppInfo">
17 <parameters>
18 <!--The value of name attribute is the name of constructor parameter
19 in AppInfo-->
20 <!--
21 The value of paramName attribute is the name of parameter in
22 IAppInfoFactory.CreateAppInfo.
23 This parameter should be present under autoMethod/methodSignature element.
24 -->
25 <!--In this example the values of name and paramName are similar, however
26 they don't have to be.-->
27 <parameterValue name="appId" paramName="appId" />
28 <parameterValue name="appDescription" paramName="appDescription" />
29 </parameters>
30 </constructedValue>
31 </default>
32 </autoMethod>
33 </autoService>
34</autoGeneratedServices>