using System;
namespace Abp.Dependency
{
///
/// Used to get a singleton of any class which can be resolved using .
/// Important: Use classes by injecting wherever possible. This class is for cases that's not possible.
///
///
public static class SingletonDependency
{
///
/// Gets the instance.
///
///
/// The instance.
///
public static T Instance => LazyInstance.Value;
private static readonly Lazy LazyInstance;
static SingletonDependency()
{
LazyInstance = new Lazy(() => IocManager.Instance.Resolve(), true);
}
}
}