public static StockDBContext GetStockDBContext()
 {
     if (instance == null)
     {
         lock (padlock)
         {
             if (instance == null)
             {
                 instance = new StockDBContext();
             }
         }
     }
     return(instance);
 }
Пример #2
0
 private StockDBContext context; // do not allow caller to access the DBContext
 public DBRepository()
 {
     context = StockDBContext.GetStockDBContext();
 }