using Valg.EVA.Skanning.ContainerExtensions;
using Unity;
using Valg.EVA.Skanning.Entity.SqlConnection;

namespace Valg.EVA.Skanning.Entity
{
    public class UnityInstaller : IUnityInstaller
    {
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope")]
        public void Install(IUnityContainer unityContainer)
        {
            unityContainer.RegisterType<ISqlConnectionFactory, SqlConnectionFactory>(ContainerLifetimes.CreateContainerControlledLifetimeManager());
            unityContainer.RegisterType<TransactionScopeFactory>(ContainerLifetimes.CreateContainerControlledLifetimeManager());
        }
    }
}
