Example #1
0
        internal static void Initialize(SalesContext context)
        {
            if (!_initialized)
            {
                lock (_lock) {
                    if (_initialized)
                    {
                        return;
                    }

                    InitializeData(context);
                }
            }
        }
Example #2
0
 private static void InitializeData(SalesContext context)
 {
     Seed(context);
 }
Example #3
0
 internal static void Reset(SalesContext context)
 {
     ResetDatabase(context);
 }
Example #4
0
 public static void Seed(SalesContext context)
 {
     SeedDatabase(context);
 }
Example #5
0
 private static void ResetDatabase(SalesContext context)
 {
     context.Products.RemoveRange(context.Products);
     context.SaveChanges();
 }