root/trunk/src/unity/OpenRasta.DI.Unity/Extensions/CycleDetector.cs @ 427

Revision 427, 0.6 KB (checked in by serialseb, 7 months ago)

trunk changes pre-RC

Line 
1using System;
2using Microsoft.Practices.Unity;
3using Microsoft.Practices.Unity.ObjectBuilder;
4using OpenRasta.DI.Unity.Extensions.Strategies;
5
6namespace OpenRasta.DI.Unity.Extensions
7{
8    /// <summary>
9    /// Adds early detection of circular references to prevent <see cref="StackOverflowException"/>s.
10    /// </summary>
11    internal class CycleDetector : UnityContainerExtension
12    {
13        protected override void Initialize()
14        {
15            Context.Strategies.AddNew<CycleDetectionStrategy>(UnityBuildStage.PreCreation);
16        }
17    }
18}
Note: See TracBrowser for help on using the browser.