IoCConfiguration_autoService.xml

This configuration file can be downloaded downloaded from IoCConfiguration_autoService.xml.

  1 <?xml version="1.0" encoding="utf-8"?>
  2
  3 <!--
  4    The XML configuration file is validated against schema file IoC.Configuration.Schema.22B4BA50-3429-48FE-8059-B9C1F855A639.xsd,
  5    which can be found in folder IoC.Configuration.Content in output directory.
  6    The schema file can also be downloaded from
  7    http://oroptimizer.com/ioc.configuration/V2/IoC.Configuration.Schema.22B4BA50-3429-48FE-8059-B9C1F855A639.xsd or in source code
  8    project in Github.com.
  9
 10    To use Visual Studio code completion based on schema contents, right click Properties on this file in Visual Studio, and in Schemas
 11    field pick the schema IoC.Configuration.Schema.22B4BA50-3429-48FE-8059-B9C1F855A639.xsd.
 12
 13    Before running the tests make sure to execute IoC.Configuration\Tests\IoC.Configuration.Tests\PostBuildCommands.bat to copy the dlls into
 14    folders specified in this configuration file.
 15    Also, modify the batch file to copy the Autofac and Ninject assemblies from Nuget packages folder on machine, where the test is run.
 16 -->
 17
 18 <iocConfiguration
 19     xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
 20     xsi:noNamespaceSchemaLocation="http://oroptimizer.com/IoC.Configuration/V2/IoC.Configuration.Schema.22B4BA50-3429-48FE-8059-B9C1F855A639.xsd">
 21
 22   <!--The application should have write permissions to path specified in appDataDir.
 23     This is where dynamically generated DLLs are saved.-->
 24   <!--NOTE: path should be an absolute path, or should be converted to absolute path by some implementation of
 25     IoC.Configuration.AttributeValueTransformer.IAttributeValueTransformer. In this example the paths are converted by
 26     IoC.Configuration.Tests.FileFolderPathAttributeValueTransformer.-->
 27   <appDataDir
 28     path="TestFiles\AutogeneratedDlls\DynamicFiles_AutoServiceTests" />
 29
 30   <plugins pluginsDirPath="TestFiles\PluginDlls">
 31
 32     <!--
 33         Plugin assemblies will be in a folder with similar name under pluginsDirPath folder.
 34         The plugin folders will be included in assembly resolution mechanism.
 35         -->
 36
 37     <!--A folder K:\...\IoC.Configuration\Tests\IoC.Configuration.Tests\bin\TestFiles\PluginDlls\Plugin1 should exist.  -->
 38     <plugin name="Plugin1" />
 39     <plugin name="Plugin2" enabled="true" />
 40     <plugin name="Plugin3" enabled="false" />
 41   </plugins>
 42
 43   <additionalAssemblyProbingPaths>
 44     <probingPath
 45       path="TestFiles\ThirdPartyLibs" />
 46     <probingPath
 47       path="TestFiles\ContainerImplementations\Autofac" />
 48     <probingPath
 49       path="TestFiles\ContainerImplementations\Ninject" />
 50     <probingPath
 51       path="TestFiles\DynamicallyLoadedDlls" />
 52   </additionalAssemblyProbingPaths>
 53
 54   <assemblies>
 55     <!--Assemblies should be in one of the following locations:
 56         1) Executable's folder
 57         2) In folder specified in additionalAssemblyProbingPaths element.
 58         3) In one of the plugin folders specified in plugins element (only for assemblies with plugin attribute) -->
 59
 60     <!--
 61         Use "overrideDirectory" attribute, to make the assembly path explicit, rather then searching for
 62         an assembly in predefined folders, which also include probing paths specified in additionalAssemblyProbingPaths element.
 63     -->
 64     <assembly name="IoC.Configuration.Autofac" alias="autofac_ext" />
 65     <assembly name="IoC.Configuration.Ninject" alias="ninject_ext" />
 66
 67     <assembly name="TestProjects.Modules" alias="modules" />
 68
 69     <assembly name="TestProjects.DynamicallyLoadedAssembly1"
 70               alias="dynamic1" />
 71
 72     <assembly name="TestProjects.DynamicallyLoadedAssembly2"
 73               alias="dynamic2" />
 74
 75     <assembly name="TestProjects.TestPluginAssembly1"
 76               alias="pluginassm1" plugin="Plugin1" />
 77
 78     <assembly name="TestProjects.TestPluginAssembly2"
 79               alias="pluginassm2" plugin="Plugin2" />
 80
 81     <assembly name="TestProjects.TestPluginAssembly3"
 82               alias="pluginassm3" plugin="Plugin3" />
 83
 84     <assembly name="TestProjects.ModulesForPlugin1"
 85               alias="modules_plugin1" plugin="Plugin1" />
 86
 87     <assembly name="TestProjects.SharedServices" alias="shared_services" />
 88
 89     <assembly name="IoC.Configuration.Tests" alias="tests" />
 90   </assemblies>
 91
 92   <typeDefinitions>
 93     <typeDefinition alias="AutoService_IInterface1" type="IoC.Configuration.Tests.AutoService.Services.IInterface1" />
 94     <typeDefinition alias="IActionValidator" type="SharedServices.Interfaces.IActionValidator" />
 95     <typeDefinition alias="IProjectGuids" type="IoC.Configuration.Tests.AutoService.Services.IProjectGuids" />
 96     <typeDefinition alias="ActionTypes" type="SharedServices.DataContracts.ActionTypes" />
 97     <typeDefinition alias="Guid" type="System.Guid" />
 98   </typeDefinitions>
 99
100   <parameterSerializers>
101     <serializers></serializers>
102   </parameterSerializers>
103
104   <!--The value of type attribute should be a type that implements
105     IoC.Configuration.DiContainer.IDiManager-->
106   <diManagers activeDiManagerName="Autofac">
107     <diManager name="Ninject" type="IoC.Configuration.Ninject.NinjectDiManager"
108                assembly="ninject_ext">
109       <!--
110             Use parameters element to specify constructor parameters,
111             if the type specified in 'type' attribute has non-default constructor.
112             -->
113       <!--<parameters>
114             </parameters>-->
115     </diManager>
116
117     <diManager name="Autofac" type="IoC.Configuration.Autofac.AutofacDiManager"
118                assembly="autofac_ext">
119     </diManager>
120   </diManagers>
121
122   <!--
123     If settingsRequestor element is used, the type in type attribute should
124     specify a type that implements IoC.Configuration.ISettingsRequestor.
125     The implementation specifies a collection of required settings that should be present
126     in settings element.
127     Note, the type specified in type attribute is fully integrated into a dependency
128     injection framework. In other words, constructor parameters will be injected using
129     bindings specified in dependencyInjection element.
130     -->
131
132   <settings>
133     <constructedValue name="DefaultDBConnection" type="SharedServices.Implementations.SqliteDbConnection">
134       <parameters>
135         <string name="filePath" value="c:\SQLiteFiles\MySqliteDb.sqlite"/>
136       </parameters>
137     </constructedValue>
138
139     <object name="Project1Guid" typeRef="Guid" value="EA91B230-3FF8-43FA-978B-3261493D58A3" />
140     <object name="Project2Guid" typeRef="Guid" value="9EDC7F1A-6BD6-4277-9015-5A9277218681" />
141   </settings>
142
143   <dependencyInjection>
144     <modules>
145       <module type="IoC.Configuration.Tests.PrimitiveTypeDefaultBindingsModule">
146         <parameters>
147           <!--Date time can be also long value for ticks. For example the datetime value below can
148           be replaced with 604096704000000000-->
149           <datetime name="defaultDateTime" value="1915-04-24 00:00:00.000" />
150           <double name="defaultDouble" value="0" />
151           <int16 name="defaultInt16" value="0" />
152           <classMember name="defaultInt32" class="System.Int32" memberName="MinValue"/>
153         </parameters>
154       </module>
155
156       <module type="IoC.Configuration.Tests.AutoService.AutoServiceTestsModule" />
157     </modules>
158     <services>
159
160     </services>
161
162     <autoGeneratedServices>
163
164       <!--The scope for autoService implementations is always singleton -->
165       <autoService interfaceRef="IProjectGuids" >
166
167         <!--Note, since property Project1 in IoC.Configuration.Tests.AutoService.Services.IProjectGuids has
168         a setter, the implementation will implement the setter as well.-->
169         <autoProperty name="Project1" returnTypeRef="Guid">
170           <object typeRef="Guid" value="966FE6A6-76AC-4895-84B2-47E27E58FD02"/>
171         </autoProperty>
172
173         <autoProperty name="Project2" returnTypeRef="Guid">
174           <object typeRef="Guid" value="AC4EE351-CE69-4F89-A362-F833489FD9A1"/>
175         </autoProperty>
176
177         <autoMethod name="GetDefaultProject" returnTypeRef="Guid">
178           <!--No methodSignature is required, since the method does not have any parameters.-->
179           <default>
180             <!--TODO: change the returned value to classMember which references IProjectGuids.Project1 -->
181             <object typeRef="Guid" value="1E08071B-D02C-4830-AE3C-C9E78A29EA37"/>
182
183           </default>
184         </autoMethod>
185
186         <!---IoC.Configuration.Tests.AutoService.Services.IProjectGuids also has a method NotImplementedMethod()
187         which will be auto-implemented as well.-->
188       </autoService>
189
190       <!--Demo of referencing auto-implemented method parameters using parameterValue element-->
191       <autoService interface="IoC.Configuration.Tests.AutoService.Services.IAppInfoFactory">
192         <autoMethod name="CreateAppInfo" returnType="IoC.Configuration.Tests.AutoService.Services.IAppInfo">
193           <methodSignature>
194             <int32 paramName="appId"/>
195             <string paramName="appDescription"/>
196           </methodSignature>
197
198           <default>
199             <constructedValue type="IoC.Configuration.Tests.AutoService.Services.AppInfo">
200               <parameters>
201                 <!--The value of name attribute is the name of constructor parameter in AppInfo-->
202                 <!--
203                 The value of paramName attribute is the name of parameter in IAppInfoFactory.CreateAppInfo.
204                 This parameter should be present under autoMethod/methodSignature element.
205                 -->
206                 <!--In this example the values of name and paramName are similar, however they don't
207                 have to be.-->
208                 <parameterValue name="appId" paramName="appId" />
209                 <parameterValue name="appDescription" paramName="appDescription" />
210               </parameters>
211             </constructedValue>
212           </default>
213         </autoMethod>
214       </autoService>
215
216       <!--The scope for autoService implementations is always singleton -->
217       <autoService interface="IoC.Configuration.Tests.AutoService.Services.IActionValidatorFactory">
218
219         <autoProperty name="DefaultActionValidator" returnType="SharedServices.Interfaces.IActionValidator">
220           <injectedObject type="IoC.Configuration.Tests.AutoService.Services.ActionValidatorDefault"/>
221         </autoProperty>
222
223         <autoProperty name="PublicProjectId" returnType="System.Guid" >
224             <object type="System.Guid" value="95E352DD-5C79-49D0-BD51-D62153570B61"/>
225         </autoProperty>
226
227         <autoMethod name="GetValidators"
228                     returnType="System.Collections.Generic.IReadOnlyList[SharedServices.Interfaces.IActionValidator]"
229                     reuseValue="true">
230
231           <methodSignature>
232             <!--paramName attribute is optional, however it makes the auto-implementation more readable. -->
233
234             <object paramName="actionType" typeRef="ActionTypes"/>
235             <object paramName="projectGuid" type="System.Guid"/>
236           </methodSignature>
237
238           <!--Parameter actionType (parameter1) value: In this example we use class member ViewFilesList (enum value) in enumeration
239           SharedServices.DataContracts.ActionTypes. Note, we use alias ActionTypes to reference the enum type declared in typeDefinitions section.
240           -->
241           <!--Parameter projectGuid (parameter2) value: The string "F79C3F23-C63F-4EB0-A513-7A8772A82B35" will be de-serialized to a System.Guid value,
242           using the default OROptimizer.Serializer.TypeBasedSimpleSerializerGuid serializer. More serializers can be provided in section
243           parameterSerializers-->
244           <if parameter1="_classMember:ActionTypes.ViewFilesList" parameter2="8663708F-C707-47E1-AEDC-2CD9291AD4CB">
245             <collection>
246               <constructedValue type="SharedServices.Implementations.ActionValidator3">
247                 <parameters>
248                   <int32 name="intParam" value="7"/>
249                 </parameters>
250               </constructedValue>
251
252               <!--Constructor of ActionValidatorWithDependencyOnActionValidatorFactory has a parameter of type
253               IoC.Configuration.Tests.AutoService.Services.IActionValidatorFactory. Therefore an instance of auto-generated service  IActionValidatorFactory
254               will be injected.
255               -->
256               <injectedObject type="IoC.Configuration.Tests.AutoService.Services.ActionValidatorWithDependencyOnActionValidatorFactory"/>
257
258               <constructedValue type=" IoC.Configuration.Tests.AutoService.Services.ActionValidator1" >
259                 <parameters>
260                   <injectedObject name="param1" typeRef="AutoService_IInterface1" />
261                 </parameters>
262                 <injectedProperties>
263                   <!-- Note, we could have used constructedValue element to inject a constructed value into property
264                     ActionValidator1.Property2. However, to keep the example simple, injectedObject was used -->
265                   <injectedObject name="Property2" type="IoC.Configuration.Tests.AutoService.Services.IInterface2" />
266                 </injectedProperties>
267               </constructedValue>
268
269               <injectedObject type="TestPluginAssembly1.Implementations.Plugin1ActionValidator"/>
270
271               <classMember class="IoC.Configuration.Tests.AutoService.Services.StaticAndConstMembers" memberName="ActionValidator1" />
272
273               <!--Since DefaultActionValidator property in IoC.Configuration.Tests.AutoService.Services.IActionValidatorValuesProvider interface is
274               not static, IoC.Configuration.Tests.AutoService.Services.IActionValidatorValuesProvider will be injected.
275               Therefore, a binding should be setup for this class (or the interface should be auto-implemented
276               using autoService element)
277               -->
278               <classMember class="IoC.Configuration.Tests.AutoService.Services.IActionValidatorValuesProvider"
279                            memberName="DefaultActionValidator"/>
280
281               <!--Since Plugin3 is disabled, Plugin3ActionValidator will be ignored -->
282               <injectedObject type="TestPluginAssembly3.Implementations.Plugin3ActionValidator"/>
283             </collection>
284           </if>
285
286           <!--Parameter actionType (parameter1) value: In this example we use full class path for
287           SharedServices.DataContracts.ActionTypes in parameter1, instead of referencing a type declared in typeDefinitions element.
288           -->
289           <!--Parameter projectGuid (parameter2) value: In this case we reference the Project1Guid setting value in settings section, instead
290           of using a Guid string-->
291           <if parameter1="_classMember:ActionTypes.ViewFileContents" parameter2="_settings:Project1Guid">
292             <collection>
293               <!--Since IoC.Configuration.Tests.AutoService.Services.ActionValidator1 and SharedServices.Implementations.ActionValidator2 are
294                 concrete (non-interface and non-abstract) classes), and have public constructors,
295                 self bound service bindings for these classes will be automatically added, if binding for these classes are not specified
296                 in configuration file or in some module of type IoC.Configuration.DiContainer.IDiModule -->
297
298               <injectedObject type="IoC.Configuration.Tests.AutoService.Services.ActionValidator1" />
299
300               <!--Since GetViewOnlyActionvalidator() method in IoC.Configuration.Tests.AutoService.Services.IActionValidatorValuesProvider
301               interface is not static, IoC.Configuration.Tests.AutoService.Services.IActionValidatorValuesProvider will be injected.
302               Therefore, a binding should be setup for this class (or the interface should be auto-implemented using
303               autoService element).
304               -->
305               <classMember class="IoC.Configuration.Tests.AutoService.Services.IActionValidatorValuesProvider"
306                            memberName="GetViewOnlyActionvalidator"/>
307             </collection>
308           </if>
309
310           <!--Parameter actionType (parameter1) value: In this case we use constant value DefaultActionType declared in
311           class IoC.Configuration.Tests.AutoService.Services.StaticAndConstMembers.
312           -->
313           <!--Parameter projectGuid (parameter2) value: In this case we use the value of property Project1 in
314           IoC.Configuration.Tests.AutoService.Services.IProjectGuids. Since the property Project1 is not static,
315           class IoC.Configuration.Tests.AutoService.Services.IProjectGuids will be injected.
316           -->
317           <if parameter1="_classMember:IoC.Configuration.Tests.AutoService.Services.StaticAndConstMembers.DefaultActionType"
318               parameter2="_classMember:IProjectGuids.Project1">
319             <collection>
320               <!--Lets assume no validators are needed for this case-->
321             </collection>
322           </if>
323
324           <!--Parameter actionType (parameter1) value: In this case we use enum value
325           SharedServices.DataContracts.ActionTypes.ViewFileContents. We use a shortcut (an alias) ActionTypes to reference a
326           reference the class SharedServices.DataContracts.ActionTypes declared in typeDefintions section.
327           -->
328           <!--Parameter projectGuid (parameter2) value: In this case we use the value returned by a call to static method
329           GetDefaultProjectGuid() in class IoC.Configuration.Tests.AutoService.Services.StaticAndConstMembers.
330           -->
331           <if parameter1="_classMember:ActionTypes.ViewFileContents"
332               parameter2="_classMember:IoC.Configuration.Tests.AutoService.Services.StaticAndConstMembers.GetDefaultProjectGuid">
333
334             <!--Continue here.-->
335             <collection>
336               <!--Since IoC.Configuration.Tests.AutoService.Services.ActionValidator1 and SharedServices.Implementations.ActionValidator2 are
337                 concrete (non-interface and non-abstract classes), and have public constructors,
338                 self bound service bindings for these classes will be automatically added, if binding for these classes
339                 are not specified in configuration file or in some module of type IoC.Configuration.DiContainer.IDiModule -->
340
341               <injectedObject type="SharedServices.Implementations.ActionValidator2" />
342               <injectedObject type="IoC.Configuration.Tests.AutoService.Services.ActionValidator1" />
343             </collection>
344           </if>
345
346           <!--Note parameter2 references PublicProjectId property in this
347           auto-generated IoC.Configuration.Tests.AutoService.Services.IActionValidatorFactory service. -->
348           <if parameter1="_classMember:ActionTypes.ViewFilesList"
349               parameter2="_classMember:IoC.Configuration.Tests.AutoService.Services.IActionValidatorFactory.PublicProjectId">
350             <collection>
351               <!--Note, we can reference a property in this auto-generated
352               IoC.Configuration.Tests.AutoService.Services.IActionValidatorFactory service.-->
353               <classMember class="IoC.Configuration.Tests.AutoService.Services.IActionValidatorFactory" memberName="DefaultActionValidator"/>
354             </collection>
355
356           </if>
357           <!--if none of conditions above are true, the default value will be returned by interface implementation.-->
358
359           <default>
360             <collection>
361               <!--We can also call a method or property in auto-generated interface, or in one of its base interfaces.-->
362               <classMember class="IoC.Configuration.Tests.AutoService.Services.IActionValidatorFactory" memberName="DefaultActionValidator"/>
363               <injectedObject type="SharedServices.Implementations.ActionValidator3" />
364               <injectedObject type="DynamicallyLoadedAssembly2.ActionValidator4"/>
365             </collection>
366           </default>
367         </autoMethod>
368
369         <!--Overloaded method GetValidators uses parameters of types System.Int32 and System.string, instead of
370         SharedServices.DataContracts.ActionTypes and System.Guid, as in case above.-->
371         <autoMethod name="GetValidators"
372                     returnType="System.Collections.Generic.IReadOnlyList[SharedServices.Interfaces.IActionValidator]">
373           <methodSignature>
374             <!--paramName attribute is optional, however it makes the auto-implementation more readable. -->
375             <int32 paramName="actionTypeId"/>
376             <string paramName="projectGuid" />
377           </methodSignature>
378
379           <!-- Attributes parameter1 and parameter2 map values of parameters param1 and param2 in GetInstances() method to returned values. -->
380           <if parameter1="0" parameter2="8663708F-C707-47E1-AEDC-2CD9291AD4CB">
381             <collection>
382               <injectedObject type="SharedServices.Implementations.ActionValidator3" />
383               <injectedObject type="IoC.Configuration.Tests.AutoService.Services.ActionValidator4" />
384             </collection>
385           </if>
386
387           <default>
388             <collection>
389               <!--We can also call a method or property in auto-generated interface, or in one of its base interfaces.-->
390               <classMember class="IoC.Configuration.Tests.AutoService.Services.IActionValidatorFactory"
391                            memberName="DefaultActionValidator"/>
392               <injectedObject type="SharedServices.Implementations.ActionValidator3" />
393               <classMember class="IoC.Configuration.Tests.AutoService.Services.StaticAndConstMembers"
394                            memberName="GetDefaultActionValidator" />
395               <classMember class="IoC.Configuration.Tests.AutoService.Services.IActionValidatorValuesProvider"
396                            memberName="AdminLevelActionValidator"/>
397             </collection>
398           </default>
399         </autoMethod>
400
401         <!--Note, interface IoC.Configuration.Tests.AutoService.Services.IActionValidatorFactory also has a method
402         void SomeMethodThatWillNotBeImplemented(int param1, string param2) and a property int SomeUnImplementedProperty { get; },'
403         we chose not to implement in configuration file. Unimplemented methods and properties will be auto-implemented to return default values,
404         based on return type defaults.
405         -->
406       </autoService>
407
408       <!--IMemberAmbiguityDemo demonstrates cases when there are multiple occurrences
409       of auto-generated methods and properties with same signatures and return types
410       in IMemberAmbiguityDemo and its base interfaces.
411       -->
412       <autoService interface="IoC.Configuration.Tests.AutoService.Services.IMemberAmbiguityDemo">
413         <!--GetIntValues(): IReadOnlyList<int> GetIntValues(int param1, string param2)-->
414         <autoMethod name="GetIntValues" returnType="System.Collections.Generic.IReadOnlyList[System.Int32]" >
415           <methodSignature>
416             <int32 paramName="param1"/>
417             <string paramName="param2"/>
418           </methodSignature>
419           <if parameter1="1" parameter2="str1">
420             <collection>
421               <int32 value="17"/>
422             </collection>
423           </if>
424           <default>
425             <collection>
426               <int32 value="18"/>
427               <int32 value="19"/>
428             </collection>
429           </default>
430         </autoMethod>
431
432         <!--
433         This method is declared in IMemberAmbiguityDemo_Parent3, which is a base interface for IMemberAmbiguityDemo.
434         We can provide implementation for this interface, even though it has a similar signature and return type as the method
435         IoC.Configuration.Tests.AutoService.Services.IMemberAmbiguityDemo.GetIntValues.
436         By using the attribute 'declaringInterface', we make a distinction between these two.
437         -->
438         <autoMethod name="GetIntValues" returnType="System.Collections.Generic.IReadOnlyList[System.Int32]"
439                     declaringInterface="IoC.Configuration.Tests.AutoService.Services.IMemberAmbiguityDemo_Parent3">
440           <methodSignature>
441             <int32 paramName="param1"/>
442             <string paramName="param2"/>
443           </methodSignature>
444           <default>
445             <collection>
446               <int32 value="3"/>
447             </collection>
448           </default>
449         </autoMethod>
450
451         <!---
452         The method GetDbConnection(System.Guid appGuid) that return IDbConnection is in two base interfaces
453         of IMemberAmbiguityDemo: in IoC.Configuration.Tests.AutoService.Services.IMemberAmbiguityDemo_Parent1 and in
454         IoC.Configuration.Tests.AutoService.Services.IMemberAmbiguityDemo_Parent2.
455         Therefore, to avoid ambiguity, we have to specify the declaring interface in attribute 'declaringInterface'.
456         We can specify an implementation for IoC.Configuration.Tests.AutoService.Services.IMemberAmbiguityDemo_Parent2.GetDbConnection(),
457         and IoC.Configuration will generate a similar auto-implementation for the similar method in IMemberAmbiguityDemo_Parent1
458         as well.
459         -->
460         <autoMethod name="GetDbConnection" returnType="SharedServices.Interfaces.IDbConnection"
461                     declaringInterface="IoC.Configuration.Tests.AutoService.Services.IMemberAmbiguityDemo_Parent2">
462           <methodSignature>
463             <object paramName="appGuid" type="System.Guid"/>
464           </methodSignature>
465           <default>
466             <constructedValue type="SharedServices.Implementations.SqliteDbConnection">
467               <parameters>
468                 <string name="filePath" value="c:\mySqliteDatabase.sqlite"/>
469               </parameters>
470             </constructedValue>
471           </default>
472         </autoMethod>
473
474         <!--
475         Both IMemberAmbiguityDemo_Parent1 and IMemberAmbiguityDemo_Parent2 have properties called DefaultDbConnection
476         with the same return types. We can auto-implement this property for each of these interfaces by using
477         declaringInterface attribute in autoProperty element to explicitly specify the interface that own
478         the property (declaringInterface can be used in autoMethod as well as demonstrated above)
479         -->
480         <!--Auto-implementation of IMemberAmbiguityDemo_Parent1.DefaultDbConnection-->
481         <autoProperty name="DefaultDbConnection" returnType="SharedServices.Interfaces.IDbConnection"
482                       declaringInterface="IoC.Configuration.Tests.AutoService.Services.IMemberAmbiguityDemo_Parent1">
483           <constructedValue type="SharedServices.Implementations.SqliteDbConnection">
484             <parameters>
485               <string name="filePath" value="c:\IMemberAmbiguityDemo_Parent1_Db.sqlite"/>
486             </parameters>
487           </constructedValue>
488         </autoProperty>
489
490         <!--Auto-implementation of IMemberAmbiguityDemo_Parent2.DefaultDbConnection-->
491         <autoProperty name="DefaultDbConnection" returnType="SharedServices.Interfaces.IDbConnection"
492                       declaringInterface="IoC.Configuration.Tests.AutoService.Services.IMemberAmbiguityDemo_Parent2">
493           <constructedValue type="SharedServices.Implementations.SqliteDbConnection">
494             <parameters>
495               <string name="filePath" value="c:\IMemberAmbiguityDemo_Parent2_Db.sqlite"/>
496             </parameters>
497           </constructedValue>
498         </autoProperty>
499
500         <!--
501         Method GetNumericValue() occurs in both IoC.Configuration.Tests.AutoService.Services.IMemberAmbiguityDemo_Parent2
502         and IoC.Configuration.Tests.AutoService.Services.IMemberAmbiguityDemo_Parent1_Parent. However, since the return types
503         are different (System.Double in IMemberAmbiguityDemo_Parent2, and System.Int32 in IMemberAmbiguityDemo_Parent1_Parent),
504         we can auto-implement both them, without using attribute 'declaringInterface' to separate these two implementation.
505         -->
506         <!--IMemberAmbiguityDemo_Parent2.GetNumericValue() with return type of System.Double-->
507         <autoMethod name="GetNumericValue" returnType="System.Double" >
508           <default>
509             <double value="17.3"/>
510           </default>
511         </autoMethod>
512
513         <!--IMemberAmbiguityDemo_Parent1_Parent.GetNumericValue() with return type of System.Int32-->
514         <autoMethod name="GetNumericValue" returnType="System.Int32" >
515           <default>
516             <int32 value="19"/>
517           </default>
518         </autoMethod>
519
520         <!--
521         Property NumericValue occurs in both IoC.Configuration.Tests.AutoService.Services.IMemberAmbiguityDemo_Parent1
522         and IoC.Configuration.Tests.AutoService.Services.IMemberAmbiguityDemo_Parent2. However, since the return types
523         are different (System.Double in IMemberAmbiguityDemo_Parent1, and System.Int32 in IMemberAmbiguityDemo_Parent2),
524         we can auto-implement both them, without using attribute 'declaringInterface' to separate these two implementation.
525         -->
526         <!--IMemberAmbiguityDemo_Parent1.NumericValue with return type of System.Double-->
527         <autoProperty name="NumericValue" returnType="System.Double" >
528           <double value="18.2"/>
529         </autoProperty>
530
531         <!--IMemberAmbiguityDemo_Parent2.NumericValue with return type of System.Int32-->
532         <autoProperty name="NumericValue" returnType="System.Int32" >
533           <int32 value="14"/>
534         </autoProperty>
535
536         <!---Auto-implementing Method with optional parameters:
537           int MethodWithOptionalParameters(int param1, double param2 = 3.5, int param3=7); -->
538         <autoMethod name="MethodWithOptionalParameters" returnType="System.Int32">
539           <methodSignature>
540             <int32 paramName="param1"/>
541             <double paramName="param2"/>
542             <int32 paramName="param3"/>
543           </methodSignature>
544           <if parameter1="3" parameter2="3.5" parameter3="7">
545             <int32 value="17"/>
546           </if>
547           <default>
548             <int32 value="18"/>
549           </default>
550         </autoMethod>
551       </autoService>
552
553       <autoService interface="IoC.Configuration.Tests.AutoService.Services.INullableTypesTestInterface">
554         <autoMethod name="GetNullableInt" returnType="System.Nullable[System.Int32]">
555           <default>
556             <int32 value="17"/>
557           </default>
558         </autoMethod>
559
560         <autoMethod name="GetNullablesList" returnType="System.Collections.Generic.IReadOnlyList[System.Nullable[System.Int32]]">
561           <default>
562             <collection>
563               <int32 value="12" />
564               <int32 value="18" />
565             </collection>
566           </default>
567         </autoMethod>
568
569         <autoMethod name="MethodWithNullableParameter" returnType="System.Int32">
570           <methodSignature>
571             <object paramName="value"  type="System.Nullable[System.Double]"/>
572           </methodSignature>
573
574           <default>
575             <int32 value="23"/>
576           </default>
577         </autoMethod>
578
579         <autoMethod name="MethodWithParameterAsListOfNullableValues" returnType="System.Int32">
580           <methodSignature>
581             <object paramName="value"  type="System.Collections.Generic.IReadOnlyList[System.Nullable[System.Double]]"/>
582           </methodSignature>
583
584           <default>
585             <int32 value="19"/>
586           </default>
587         </autoMethod>
588
589       </autoService>
590     </autoGeneratedServices>
591   </dependencyInjection>
592
593   <startupActions>
594
595   </startupActions>
596
597   <pluginsSetup>
598     <pluginSetup plugin="Plugin1">
599       <!--The type in pluginImplementation should be non-abstract class
600                 that implements IoC.Configuration.IPlugin and which has a public constructor-->
601       <pluginImplementation type="TestPluginAssembly1.Implementations.Plugin1_Simple">
602       </pluginImplementation>
603
604       <settings>
605         <int32 name="Int32Setting1" value="10"/>
606         <string name="StringSetting1" value="Some text"/>
607       </settings>
608
609       <dependencyInjection>
610         <modules>
611
612         </modules>
613         <services>
614
615         </services>
616
617         <autoGeneratedServices>
618           <autoService interface="TestPluginAssembly1.Interfaces.IResourceAccessValidatorFactory">
619             <autoMethod name="GetValidators"
620                         returnType="System.Collections.Generic.IEnumerable[TestPluginAssembly1.Interfaces.IResourceAccessValidator]"
621                         reuseValue="true" >
622               <methodSignature>
623                 <string paramName="resourceName"/>
624               </methodSignature>
625               <if parameter1="public_pages">
626                 <collection>
627                   <injectedObject type="TestPluginAssembly1.Interfaces.ResourceAccessValidator1"/>
628                 </collection>
629
630               </if>
631               <if parameter1="admin_pages">
632                 <collection>
633                   <injectedObject type="TestPluginAssembly1.Interfaces.ResourceAccessValidator1"/>
634                   <injectedObject type="TestPluginAssembly1.Interfaces.ResourceAccessValidator2"/>
635                 </collection>
636               </if>
637               <default>
638                 <collection>
639                   <injectedObject type="TestPluginAssembly1.Interfaces.ResourceAccessValidator2"/>
640                   <injectedObject type="TestPluginAssembly1.Interfaces.ResourceAccessValidator1"/>
641                 </collection>
642               </default>
643             </autoMethod>
644           </autoService>
645         </autoGeneratedServices>
646       </dependencyInjection>
647     </pluginSetup>
648
649     <pluginSetup plugin="Plugin2">
650       <pluginImplementation type="TestPluginAssembly2.Implementations.Plugin2" assembly="pluginassm2">
651         <parameters>
652           <boolean name="param1" value="true" />
653           <double name="param2" value="25.3" />
654           <string name="param3" value="String value" />
655         </parameters>
656       </pluginImplementation>
657       <settings>
658       </settings>
659       <dependencyInjection>
660         <modules>
661         </modules>
662         <services>
663         </services>
664         <autoGeneratedServices>
665         </autoGeneratedServices>
666       </dependencyInjection>
667     </pluginSetup>
668
669     <pluginSetup plugin="Plugin3">
670       <pluginImplementation type="TestPluginAssembly3.Implementations.Plugin3" assembly="pluginassm3">
671
672       </pluginImplementation>
673       <settings>
674       </settings>
675       <dependencyInjection>
676         <modules>
677         </modules>
678         <services>
679         </services>
680         <autoGeneratedServices>
681         </autoGeneratedServices>
682       </dependencyInjection>
683     </pluginSetup>
684
685   </pluginsSetup>
686 </iocConfiguration>