40 lines
916 B
C#
40 lines
916 B
C#
using Autofac;
|
|
|
|
namespace BRS.Common.Model
|
|
{
|
|
public static class GlobalVar
|
|
{
|
|
|
|
public const string SEPERATOR = "|";
|
|
|
|
public static ContainerBuilder Builder { get; set; } = new ContainerBuilder();
|
|
|
|
private static object containerLock = new object();
|
|
|
|
private static IContainer container = null;
|
|
public static IContainer Container
|
|
{
|
|
get
|
|
{
|
|
if (container == null)
|
|
{
|
|
lock (containerLock)
|
|
{
|
|
if (container == null)
|
|
{
|
|
container = Builder.Build();
|
|
}
|
|
}
|
|
}
|
|
|
|
return container;
|
|
}
|
|
}
|
|
|
|
//public static void InitialAutoFac()
|
|
//{
|
|
// Container = Builder.Build();
|
|
//}
|
|
}
|
|
}
|