IoCConfiguration_autoService.xmlΒΆ

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

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
 <?xml version="1.0" encoding="utf-8"?>

 <!--
    The XML configuration file is validated against schema file IoC.Configuration.Schema.7579ADB2-0FBD-4210-A8CA-EE4B4646DB3F.xsd,
    which can be found in folder IoC.Configuration.Content in output directory.
    The schema file can also be downloaded from
    http://oroptimizer.com/ioc.configuration/V2/IoC.Configuration.Schema.7579ADB2-0FBD-4210-A8CA-EE4B4646DB3F.xsd or in source code
    project in Github.com.

    To use Visual Studio code completion based on schema contents, right click Properties on this file in Visual Studio, and in Schemas
    field pick the schema IoC.Configuration.Schema.7579ADB2-0FBD-4210-A8CA-EE4B4646DB3F.xsd.

    Before running the tests make sure to execute IoC.Configuration\Tests\IoC.Configuration.Tests\PostBuildCommands.bat to copy the dlls into
    folders specified in this configuration file.
    Also, modify the batch file to copy the Autofac and Ninject assemblies from Nuget packages folder on machine, where the test is run.
 -->

 <iocConfiguration
     xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
     xsi:noNamespaceSchemaLocation="http://oroptimizer.com/IoC.Configuration/V2/IoC.Configuration.Schema.7579ADB2-0FBD-4210-A8CA-EE4B4646DB3F.xsd">

   <!--The application should have write permissions to path specified in appDataDir.
     This is where dynamically generated DLLs are saved.-->
   <!--NOTE: path should be an absolute path, or should be converted to absolute path by some implementation of
     IoC.Configuration.AttributeValueTransformer.IAttributeValueTransformer. In this example the paths are converted by
     IoC.Configuration.Tests.FileFolderPathAttributeValueTransformer.-->
   <appDataDir
     path="TestFiles\AutogeneratedDlls\DynamicFiles_AutoServiceTests" />

   <plugins pluginsDirPath="TestFiles\PluginDlls">

     <!--
         Plugin assemblies will be in a folder with similar name under pluginsDirPath folder.
         The plugin folders will be included in assembly resolution mechanism.
         -->

     <!--A folder K:\...\IoC.Configuration\Tests\IoC.Configuration.Tests\bin\TestFiles\PluginDlls\Plugin1 should exist.  -->
     <plugin name="Plugin1" />
     <plugin name="Plugin2" enabled="true" />
     <plugin name="Plugin3" enabled="false" />
   </plugins>

   <additionalAssemblyProbingPaths>
     <probingPath
       path="TestFiles\ThirdPartyLibs" />
     <probingPath
       path="TestFiles\ContainerImplementations\Autofac" />
     <probingPath
       path="TestFiles\ContainerImplementations\Ninject" />
     <probingPath
       path="TestFiles\DynamicallyLoadedDlls" />
   </additionalAssemblyProbingPaths>

   <assemblies>
     <!--Assemblies should be in one of the following locations:
         1) Executable's folder
         2) In folder specified in additionalAssemblyProbingPaths element.
         3) In one of the plugin folders specified in plugins element (only for assemblies with plugin attribute) -->

     <!--
         Use "overrideDirectory" attribute, to make the assembly path explicit, rather then searching for
         an assembly in predefined folders, which also include probing paths specified in additionalAssemblyProbingPaths element.
     -->
     <assembly name="IoC.Configuration.Autofac" alias="autofac_ext" />
     <assembly name="IoC.Configuration.Ninject" alias="ninject_ext" />

     <assembly name="TestProjects.Modules" alias="modules" />

     <assembly name="TestProjects.DynamicallyLoadedAssembly1"
               alias="dynamic1" />

     <assembly name="TestProjects.DynamicallyLoadedAssembly2"
               alias="dynamic2" />

     <assembly name="TestProjects.TestPluginAssembly1"
               alias="pluginassm1" plugin="Plugin1" />

     <assembly name="TestProjects.TestPluginAssembly2"
               alias="pluginassm2" plugin="Plugin2" />

     <assembly name="TestProjects.TestPluginAssembly3"
               alias="pluginassm3" plugin="Plugin3" />

     <assembly name="TestProjects.ModulesForPlugin1"
               alias="modules_plugin1" plugin="Plugin1" />

     <assembly name="TestProjects.SharedServices" alias="shared_services" />

     <assembly name="IoC.Configuration.Tests" alias="tests" />
   </assemblies>

   <typeDefinitions>
     <typeDefinition alias="AutoService_IInterface1" type="IoC.Configuration.Tests.AutoService.Services.IInterface1" />
     <typeDefinition alias="IActionValidator" type="SharedServices.Interfaces.IActionValidator" />
     <typeDefinition alias="IProjectGuids" type="IoC.Configuration.Tests.AutoService.Services.IProjectGuids" />
     <typeDefinition alias="ActionTypes" type="SharedServices.DataContracts.ActionTypes" />
     <typeDefinition alias="Guid" type="System.Guid" />
   </typeDefinitions>

   <parameterSerializers>
     <serializers></serializers>
   </parameterSerializers>

   <!--The value of type attribute should be a type that implements
     IoC.Configuration.DiContainer.IDiManager-->
   <diManagers activeDiManagerName="Autofac">
     <diManager name="Ninject" type="IoC.Configuration.Ninject.NinjectDiManager"
                assembly="ninject_ext">
       <!--
             Use parameters element to specify constructor parameters,
             if the type specified in 'type' attribute has non-default constructor.
             -->
       <!--<parameters>
             </parameters>-->
     </diManager>

     <diManager name="Autofac" type="IoC.Configuration.Autofac.AutofacDiManager"
                assembly="autofac_ext">
     </diManager>
   </diManagers>

   <!--
     If settingsRequestor element is used, the type in type attribute should
     specify a type that implements IoC.Configuration.ISettingsRequestor.
     The implementation specifies a collection of required settings that should be present
     in settings element.
     Note, the type specified in type attribute is fully integrated into a dependency
     injection framework. In other words, constructor parameters will be injected using
     bindings specified in dependencyInjection element.
     -->

   <settings>
     <constructedValue name="DefaultDBConnection" type="SharedServices.Implementations.SqliteDbConnection">
       <parameters>
         <string name="filePath" value="c:\SQLiteFiles\MySqliteDb.sqlite"/>
       </parameters>
     </constructedValue>

     <object name="Project1Guid" typeRef="Guid" value="EA91B230-3FF8-43FA-978B-3261493D58A3" />
     <object name="Project2Guid" typeRef="Guid" value="9EDC7F1A-6BD6-4277-9015-5A9277218681" />
   </settings>

   <dependencyInjection>
     <modules>
       <module type="IoC.Configuration.Tests.PrimitiveTypeDefaultBindingsModule">
         <parameters>
           <!--Date time can be also long value for ticks. For example the datetime value below can
           be replaced with 604096704000000000-->
           <datetime name="defaultDateTime" value="1915-04-24 00:00:00.000" />
           <double name="defaultDouble" value="0" />
           <int16 name="defaultInt16" value="0" />
           <classMember name="defaultInt32" class="System.Int32" memberName="MinValue"/>
         </parameters>
       </module>

       <module type="IoC.Configuration.Tests.AutoService.AutoServiceTestsModule" />
     </modules>
     <services>

     </services>

     <autoGeneratedServices>

       <!--The scope for autoService implementations is always singleton -->
       <autoService interfaceRef="IProjectGuids" >

         <!--Note, since property Project1 in IoC.Configuration.Tests.AutoService.Services.IProjectGuids has
         a setter, the implementation will implement the setter as well.-->
         <autoProperty name="Project1" returnTypeRef="Guid">
           <object typeRef="Guid" value="966FE6A6-76AC-4895-84B2-47E27E58FD02"/>
         </autoProperty>

         <autoProperty name="Project2" returnTypeRef="Guid">
           <object typeRef="Guid" value="AC4EE351-CE69-4F89-A362-F833489FD9A1"/>
         </autoProperty>

         <autoMethod name="GetDefaultProject" returnTypeRef="Guid">
           <!--No methodSignature is required, since the method does not have any parameters.-->
           <default>
             <!--TODO: change the returned value to classMember which references IProjectGuids.Project1 -->
             <object typeRef="Guid" value="1E08071B-D02C-4830-AE3C-C9E78A29EA37"/>

           </default>
         </autoMethod>

         <!---IoC.Configuration.Tests.AutoService.Services.IProjectGuids also has a method NotImplementedMethod()
         which will be auto-implemented as well.-->
       </autoService>

       <!--Demo of referencing auto-implemented method parameters using parameterValue element-->
       <autoService interface="IoC.Configuration.Tests.AutoService.Services.IAppInfoFactory">
         <autoMethod name="CreateAppInfo" returnType="IoC.Configuration.Tests.AutoService.Services.IAppInfo">
           <methodSignature>
             <int32 paramName="appId"/>
             <string paramName="appDescription"/>
           </methodSignature>

           <default>
             <constructedValue type="IoC.Configuration.Tests.AutoService.Services.AppInfo">
               <parameters>
                 <!--The value of name attribute is the name of constructor parameter in AppInfo-->
                 <!--
                 The value of paramName attribute is the name of parameter in IAppInfoFactory.CreateAppInfo.
                 This parameter should be present under autoMethod/methodSignature element.
                 -->
                 <!--In this example the values of name and paramName are similar, however they don't
                 have to be.-->
                 <parameterValue name="appId" paramName="appId" />
                 <parameterValue name="appDescription" paramName="appDescription" />
               </parameters>
             </constructedValue>
           </default>
         </autoMethod>
       </autoService>

       <!--The scope for autoService implementations is always singleton -->
       <autoService interface="IoC.Configuration.Tests.AutoService.Services.IActionValidatorFactory">

         <autoProperty name="DefaultActionValidator" returnType="SharedServices.Interfaces.IActionValidator">
           <injectedObject type="IoC.Configuration.Tests.AutoService.Services.ActionValidatorDefault"/>
         </autoProperty>

         <autoProperty name="PublicProjectId" returnType="System.Guid" >
             <object type="System.Guid" value="95E352DD-5C79-49D0-BD51-D62153570B61"/>
         </autoProperty>

         <autoMethod name="GetValidators"
                     returnType="System.Collections.Generic.IReadOnlyList[SharedServices.Interfaces.IActionValidator]"
                     reuseValue="true">

           <methodSignature>
             <!--paramName attribute is optional, however it makes the auto-implementation more readable. -->

             <object paramName="actionType" typeRef="ActionTypes"/>
             <object paramName="projectGuid" type="System.Guid"/>
           </methodSignature>

           <!--Parameter actionType (parameter1) value: In this example we use class member ViewFilesList (enum value) in enumeration
           SharedServices.DataContracts.ActionTypes. Note, we use alias ActionTypes to reference the enum type declared in typeDefinitions section.
           -->
           <!--Parameter projectGuid (parameter2) value: The string "F79C3F23-C63F-4EB0-A513-7A8772A82B35" will be de-serialized to a System.Guid value,
           using the default OROptimizer.Serializer.TypeBasedSimpleSerializerGuid serializer. More serializers can be provided in section
           parameterSerializers-->
           <if parameter1="_classMember:ActionTypes.ViewFilesList" parameter2="8663708F-C707-47E1-AEDC-2CD9291AD4CB">
             <collection>
               <constructedValue type="SharedServices.Implementations.ActionValidator3">
                 <parameters>
                   <int32 name="intParam" value="7"/>
                 </parameters>
               </constructedValue>

               <!--Constructor of ActionValidatorWithDependencyOnActionValidatorFactory has a parameter of type
               IoC.Configuration.Tests.AutoService.Services.IActionValidatorFactory. Therefore an instance of auto-generated service  IActionValidatorFactory
               will be injected.
               -->
               <injectedObject type="IoC.Configuration.Tests.AutoService.Services.ActionValidatorWithDependencyOnActionValidatorFactory"/>

               <constructedValue type=" IoC.Configuration.Tests.AutoService.Services.ActionValidator1" >
                 <parameters>
                   <injectedObject name="param1" typeRef="AutoService_IInterface1" />
                 </parameters>
                 <injectedProperties>
                   <!-- Note, we could have used constructedValue element to inject a constructed value into property
                     ActionValidator1.Property2. However, to keep the example simple, injectedObject was used -->
                   <injectedObject name="Property2" type="IoC.Configuration.Tests.AutoService.Services.IInterface2" />
                 </injectedProperties>
               </constructedValue>

               <injectedObject type="TestPluginAssembly1.Implementations.Plugin1ActionValidator"/>

               <classMember class="IoC.Configuration.Tests.AutoService.Services.StaticAndConstMembers" memberName="ActionValidator1" />

               <!--Since DefaultActionValidator property in IoC.Configuration.Tests.AutoService.Services.IActionValidatorValuesProvider interface is
               not static, IoC.Configuration.Tests.AutoService.Services.IActionValidatorValuesProvider will be injected.
               Therefore, a binding should be setup for this class (or the interface should be auto-implemented
               using autoService element)
               -->
               <classMember class="IoC.Configuration.Tests.AutoService.Services.IActionValidatorValuesProvider"
                            memberName="DefaultActionValidator"/>

               <!--Since Plugin3 is disabled, Plugin3ActionValidator will be ignored -->
               <injectedObject type="TestPluginAssembly3.Implementations.Plugin3ActionValidator"/>
             </collection>
           </if>

           <!--Parameter actionType (parameter1) value: In this example we use full class path for
           SharedServices.DataContracts.ActionTypes in parameter1, instead of referencing a type declared in typeDefinitions element.
           -->
           <!--Parameter projectGuid (parameter2) value: In this case we reference the Project1Guid setting value in settings section, instead
           of using a Guid string-->
           <if parameter1="_classMember:ActionTypes.ViewFileContents" parameter2="_settings:Project1Guid">
             <collection>
               <!--Since IoC.Configuration.Tests.AutoService.Services.ActionValidator1 and SharedServices.Implementations.ActionValidator2 are
                 concrete (non-interface and non-abstract) classes), and have public constructors,
                 self bound service bindings for these classes will be automatically added, if binding for these classes are not specified
                 in configuration file or in some module of type IoC.Configuration.DiContainer.IDiModule -->

               <injectedObject type="IoC.Configuration.Tests.AutoService.Services.ActionValidator1" />

               <!--Since GetViewOnlyActionvalidator() method in IoC.Configuration.Tests.AutoService.Services.IActionValidatorValuesProvider
               interface is not static, IoC.Configuration.Tests.AutoService.Services.IActionValidatorValuesProvider will be injected.
               Therefore, a binding should be setup for this class (or the interface should be auto-implemented using
               autoService element).
               -->
               <classMember class="IoC.Configuration.Tests.AutoService.Services.IActionValidatorValuesProvider"
                            memberName="GetViewOnlyActionvalidator"/>
             </collection>
           </if>

           <!--Parameter actionType (parameter1) value: In this case we use constant value DefaultActionType declared in
           class IoC.Configuration.Tests.AutoService.Services.StaticAndConstMembers.
           -->
           <!--Parameter projectGuid (parameter2) value: In this case we use the value of property Project1 in
           IoC.Configuration.Tests.AutoService.Services.IProjectGuids. Since the property Project1 is not static,
           class IoC.Configuration.Tests.AutoService.Services.IProjectGuids will be injected.
           -->
           <if parameter1="_classMember:IoC.Configuration.Tests.AutoService.Services.StaticAndConstMembers.DefaultActionType"
               parameter2="_classMember:IProjectGuids.Project1">
             <collection>
               <!--Lets assume no validators are needed for this case-->
             </collection>
           </if>

           <!--Parameter actionType (parameter1) value: In this case we use enum value
           SharedServices.DataContracts.ActionTypes.ViewFileContents. We use a shortcut (an alias) ActionTypes to reference a
           reference the class SharedServices.DataContracts.ActionTypes declared in typeDefintions section.
           -->
           <!--Parameter projectGuid (parameter2) value: In this case we use the value returned by a call to static method
           GetDefaultProjectGuid() in class IoC.Configuration.Tests.AutoService.Services.StaticAndConstMembers.
           -->
           <if parameter1="_classMember:ActionTypes.ViewFileContents"
               parameter2="_classMember:IoC.Configuration.Tests.AutoService.Services.StaticAndConstMembers.GetDefaultProjectGuid">

             <!--Continue here.-->
             <collection>
               <!--Since IoC.Configuration.Tests.AutoService.Services.ActionValidator1 and SharedServices.Implementations.ActionValidator2 are
                 concrete (non-interface and non-abstract classes), and have public constructors,
                 self bound service bindings for these classes will be automatically added, if binding for these classes
                 are not specified in configuration file or in some module of type IoC.Configuration.DiContainer.IDiModule -->

               <injectedObject type="SharedServices.Implementations.ActionValidator2" />
               <injectedObject type="IoC.Configuration.Tests.AutoService.Services.ActionValidator1" />
             </collection>
           </if>

           <!--Note parameter2 references PublicProjectId property in this
           auto-generated IoC.Configuration.Tests.AutoService.Services.IActionValidatorFactory service. -->
           <if parameter1="_classMember:ActionTypes.ViewFilesList"
               parameter2="_classMember:IoC.Configuration.Tests.AutoService.Services.IActionValidatorFactory.PublicProjectId">
             <collection>
               <!--Note, we can reference a property in this auto-generated
               IoC.Configuration.Tests.AutoService.Services.IActionValidatorFactory service.-->
               <classMember class="IoC.Configuration.Tests.AutoService.Services.IActionValidatorFactory" memberName="DefaultActionValidator"/>
             </collection>

           </if>
           <!--if none of conditions above are true, the default value will be returned by interface implementation.-->

           <default>
             <collection>
               <!--We can also call a method or property in auto-generated interface, or in one of its base interfaces.-->
               <classMember class="IoC.Configuration.Tests.AutoService.Services.IActionValidatorFactory" memberName="DefaultActionValidator"/>
               <injectedObject type="SharedServices.Implementations.ActionValidator3" />
               <injectedObject type="DynamicallyLoadedAssembly2.ActionValidator4"/>
             </collection>
           </default>
         </autoMethod>

         <!--Overloaded method GetValidators uses parameters of types System.Int32 and System.string, instead of
         SharedServices.DataContracts.ActionTypes and System.Guid, as in case above.-->
         <autoMethod name="GetValidators"
                     returnType="System.Collections.Generic.IReadOnlyList[SharedServices.Interfaces.IActionValidator]">
           <methodSignature>
             <!--paramName attribute is optional, however it makes the auto-implementation more readable. -->
             <int32 paramName="actionTypeId"/>
             <string paramName="projectGuid" />
           </methodSignature>

           <!-- Attributes parameter1 and parameter2 map values of parameters param1 and param2 in GetInstances() method to returned values. -->
           <if parameter1="0" parameter2="8663708F-C707-47E1-AEDC-2CD9291AD4CB">
             <collection>
               <injectedObject type="SharedServices.Implementations.ActionValidator3" />
               <injectedObject type="IoC.Configuration.Tests.AutoService.Services.ActionValidator4" />
             </collection>
           </if>

           <default>
             <collection>
               <!--We can also call a method or property in auto-generated interface, or in one of its base interfaces.-->
               <classMember class="IoC.Configuration.Tests.AutoService.Services.IActionValidatorFactory"
                            memberName="DefaultActionValidator"/>
               <injectedObject type="SharedServices.Implementations.ActionValidator3" />
               <classMember class="IoC.Configuration.Tests.AutoService.Services.StaticAndConstMembers"
                            memberName="GetDefaultActionValidator" />
               <classMember class="IoC.Configuration.Tests.AutoService.Services.IActionValidatorValuesProvider"
                            memberName="AdminLevelActionValidator"/>
             </collection>
           </default>
         </autoMethod>

         <!--Note, interface IoC.Configuration.Tests.AutoService.Services.IActionValidatorFactory also has a method
         void SomeMethodThatWillNotBeImplemented(int param1, string param2) and a property int SomeUnImplementedProperty { get; },'
         we chose not to implement in configuration file. Unimplemented methods and properties will be auto-implemented to return default values,
         based on return type defaults.
         -->
       </autoService>

       <!--IMemberAmbiguityDemo demonstrates cases when there are multiple occurrences
       of auto-generated methods and properties with same signatures and return types
       in IMemberAmbiguityDemo and its base interfaces.
       -->
       <autoService interface="IoC.Configuration.Tests.AutoService.Services.IMemberAmbiguityDemo">
         <!--GetIntValues(): IReadOnlyList<int> GetIntValues(int param1, string param2)-->
         <autoMethod name="GetIntValues" returnType="System.Collections.Generic.IReadOnlyList[System.Int32]" >
           <methodSignature>
             <int32 paramName="param1"/>
             <string paramName="param2"/>
           </methodSignature>
           <if parameter1="1" parameter2="str1">
             <collection>
               <int32 value="17"/>
             </collection>
           </if>
           <default>
             <collection>
               <int32 value="18"/>
               <int32 value="19"/>
             </collection>
           </default>
         </autoMethod>

         <!--
         This method is declared in IMemberAmbiguityDemo_Parent3, which is a base interface for IMemberAmbiguityDemo.
         We can provide implementation for this interface, even though it has a similar signature and return type as the method
         IoC.Configuration.Tests.AutoService.Services.IMemberAmbiguityDemo.GetIntValues.
         By using the attribute 'declaringInterface', we make a distinction between these two.
         -->
         <autoMethod name="GetIntValues" returnType="System.Collections.Generic.IReadOnlyList[System.Int32]"
                     declaringInterface="IoC.Configuration.Tests.AutoService.Services.IMemberAmbiguityDemo_Parent3">
           <methodSignature>
             <int32 paramName="param1"/>
             <string paramName="param2"/>
           </methodSignature>
           <default>
             <collection>
               <int32 value="3"/>
             </collection>
           </default>
         </autoMethod>

         <!---
         The method GetDbConnection(System.Guid appGuid) that return IDbConnection is in two base interfaces
         of IMemberAmbiguityDemo: in IoC.Configuration.Tests.AutoService.Services.IMemberAmbiguityDemo_Parent1 and in
         IoC.Configuration.Tests.AutoService.Services.IMemberAmbiguityDemo_Parent2.
         Therefore, to avoid ambiguity, we have to specify the declaring interface in attribute 'declaringInterface'.
         We can specify an implementation for IoC.Configuration.Tests.AutoService.Services.IMemberAmbiguityDemo_Parent2.GetDbConnection(),
         and IoC.Configuration will generate a similar auto-implementation for the similar method in IMemberAmbiguityDemo_Parent1
         as well.
         -->
         <autoMethod name="GetDbConnection" returnType="SharedServices.Interfaces.IDbConnection"
                     declaringInterface="IoC.Configuration.Tests.AutoService.Services.IMemberAmbiguityDemo_Parent2">
           <methodSignature>
             <object paramName="appGuid" type="System.Guid"/>
           </methodSignature>
           <default>
             <constructedValue type="SharedServices.Implementations.SqliteDbConnection">
               <parameters>
                 <string name="filePath" value="c:\mySqliteDatabase.sqlite"/>
               </parameters>
             </constructedValue>
           </default>
         </autoMethod>

         <!--
         Both IMemberAmbiguityDemo_Parent1 and IMemberAmbiguityDemo_Parent2 have properties called DefaultDbConnection
         with the same return types. We can auto-implement this property for each of these interfaces by using
         declaringInterface attribute in autoProperty element to explicitly specify the interface that own
         the property (declaringInterface can be used in autoMethod as well as demonstrated above)
         -->
         <!--Auto-implementation of IMemberAmbiguityDemo_Parent1.DefaultDbConnection-->
         <autoProperty name="DefaultDbConnection" returnType="SharedServices.Interfaces.IDbConnection"
                       declaringInterface="IoC.Configuration.Tests.AutoService.Services.IMemberAmbiguityDemo_Parent1">
           <constructedValue type="SharedServices.Implementations.SqliteDbConnection">
             <parameters>
               <string name="filePath" value="c:\IMemberAmbiguityDemo_Parent1_Db.sqlite"/>
             </parameters>
           </constructedValue>
         </autoProperty>

         <!--Auto-implementation of IMemberAmbiguityDemo_Parent2.DefaultDbConnection-->
         <autoProperty name="DefaultDbConnection" returnType="SharedServices.Interfaces.IDbConnection"
                       declaringInterface="IoC.Configuration.Tests.AutoService.Services.IMemberAmbiguityDemo_Parent2">
           <constructedValue type="SharedServices.Implementations.SqliteDbConnection">
             <parameters>
               <string name="filePath" value="c:\IMemberAmbiguityDemo_Parent2_Db.sqlite"/>
             </parameters>
           </constructedValue>
         </autoProperty>

         <!--
         Method GetNumericValue() occurs in both IoC.Configuration.Tests.AutoService.Services.IMemberAmbiguityDemo_Parent2
         and IoC.Configuration.Tests.AutoService.Services.IMemberAmbiguityDemo_Parent1_Parent. However, since the return types
         are different (System.Double in IMemberAmbiguityDemo_Parent2, and System.Int32 in IMemberAmbiguityDemo_Parent1_Parent),
         we can auto-implement both them, without using attribute 'declaringInterface' to separate these two implementation.
         -->
         <!--IMemberAmbiguityDemo_Parent2.GetNumericValue() with return type of System.Double-->
         <autoMethod name="GetNumericValue" returnType="System.Double" >
           <default>
             <double value="17.3"/>
           </default>
         </autoMethod>

         <!--IMemberAmbiguityDemo_Parent1_Parent.GetNumericValue() with return type of System.Int32-->
         <autoMethod name="GetNumericValue" returnType="System.Int32" >
           <default>
             <int32 value="19"/>
           </default>
         </autoMethod>

         <!--
         Property NumericValue occurs in both IoC.Configuration.Tests.AutoService.Services.IMemberAmbiguityDemo_Parent1
         and IoC.Configuration.Tests.AutoService.Services.IMemberAmbiguityDemo_Parent2. However, since the return types
         are different (System.Double in IMemberAmbiguityDemo_Parent1, and System.Int32 in IMemberAmbiguityDemo_Parent2),
         we can auto-implement both them, without using attribute 'declaringInterface' to separate these two implementation.
         -->
         <!--IMemberAmbiguityDemo_Parent1.NumericValue with return type of System.Double-->
         <autoProperty name="NumericValue" returnType="System.Double" >
           <double value="18.2"/>
         </autoProperty>

         <!--IMemberAmbiguityDemo_Parent2.NumericValue with return type of System.Int32-->
         <autoProperty name="NumericValue" returnType="System.Int32" >
           <int32 value="14"/>
         </autoProperty>

         <!---Auto-implementing Method with optional parameters:
           int MethodWithOptionalParameters(int param1, double param2 = 3.5, int param3=7); -->
         <autoMethod name="MethodWithOptionalParameters" returnType="System.Int32">
           <methodSignature>
             <int32 paramName="param1"/>
             <double paramName="param2"/>
             <int32 paramName="param3"/>
           </methodSignature>
           <if parameter1="3" parameter2="3.5" parameter3="7">
             <int32 value="17"/>
           </if>
           <default>
             <int32 value="18"/>
           </default>
         </autoMethod>
       </autoService>

       <autoService interface="IoC.Configuration.Tests.AutoService.Services.INullableTypesTestInterface">
         <autoMethod name="GetNullableInt" returnType="System.Nullable[System.Int32]">
           <default>
             <int32 value="17"/>
           </default>
         </autoMethod>

         <autoMethod name="GetNullablesList" returnType="System.Collections.Generic.IReadOnlyList[System.Nullable[System.Int32]]">
           <default>
             <collection>
               <int32 value="12" />
               <int32 value="18" />
             </collection>
           </default>
         </autoMethod>

         <autoMethod name="MethodWithNullableParameter" returnType="System.Int32">
           <methodSignature>
             <object paramName="value"  type="System.Nullable[System.Double]"/>
           </methodSignature>

           <default>
             <int32 value="23"/>
           </default>
         </autoMethod>

         <autoMethod name="MethodWithParameterAsListOfNullableValues" returnType="System.Int32">
           <methodSignature>
             <object paramName="value"  type="System.Collections.Generic.IReadOnlyList[System.Nullable[System.Double]]"/>
           </methodSignature>

           <default>
             <int32 value="19"/>
           </default>
         </autoMethod>

       </autoService>
     </autoGeneratedServices>
   </dependencyInjection>

   <startupActions>

   </startupActions>

   <pluginsSetup>
     <pluginSetup plugin="Plugin1">
       <!--The type in pluginImplementation should be non-abstract class
                 that implements IoC.Configuration.IPlugin and which has a public constructor-->
       <pluginImplementation type="TestPluginAssembly1.Implementations.Plugin1_Simple">
       </pluginImplementation>

       <settings>
         <int32 name="Int32Setting1" value="10"/>
         <string name="StringSetting1" value="Some text"/>
       </settings>

       <dependencyInjection>
         <modules>

         </modules>
         <services>

         </services>

         <autoGeneratedServices>
           <autoService interface="TestPluginAssembly1.Interfaces.IResourceAccessValidatorFactory">
             <autoMethod name="GetValidators"
                         returnType="System.Collections.Generic.IEnumerable[TestPluginAssembly1.Interfaces.IResourceAccessValidator]"
                         reuseValue="true" >
               <methodSignature>
                 <string paramName="resourceName"/>
               </methodSignature>
               <if parameter1="public_pages">
                 <collection>
                   <injectedObject type="TestPluginAssembly1.Interfaces.ResourceAccessValidator1"/>
                 </collection>

               </if>
               <if parameter1="admin_pages">
                 <collection>
                   <injectedObject type="TestPluginAssembly1.Interfaces.ResourceAccessValidator1"/>
                   <injectedObject type="TestPluginAssembly1.Interfaces.ResourceAccessValidator2"/>
                 </collection>
               </if>
               <default>
                 <collection>
                   <injectedObject type="TestPluginAssembly1.Interfaces.ResourceAccessValidator2"/>
                   <injectedObject type="TestPluginAssembly1.Interfaces.ResourceAccessValidator1"/>
                 </collection>
               </default>
             </autoMethod>
           </autoService>
         </autoGeneratedServices>
       </dependencyInjection>
     </pluginSetup>

     <pluginSetup plugin="Plugin2">
       <pluginImplementation type="TestPluginAssembly2.Implementations.Plugin2" assembly="pluginassm2">
         <parameters>
           <boolean name="param1" value="true" />
           <double name="param2" value="25.3" />
           <string name="param3" value="String value" />
         </parameters>
       </pluginImplementation>
       <settings>
       </settings>
       <dependencyInjection>
         <modules>
         </modules>
         <services>
         </services>
         <autoGeneratedServices>
         </autoGeneratedServices>
       </dependencyInjection>
     </pluginSetup>

     <pluginSetup plugin="Plugin3">
       <pluginImplementation type="TestPluginAssembly3.Implementations.Plugin3" assembly="pluginassm3">

       </pluginImplementation>
       <settings>
       </settings>
       <dependencyInjection>
         <modules>
         </modules>
         <services>
         </services>
         <autoGeneratedServices>
         </autoGeneratedServices>
       </dependencyInjection>
     </pluginSetup>

   </pluginsSetup>
 </iocConfiguration>