public static void BuildIndex(int itemID, int storeId)
 {
     var repository = new StockoutRepository();
     var stockouts = GetStockOutHistory(itemID, storeId).ToList();
     if (stockouts.Count > 0)
       repository.AddRange(stockouts);
 }
        public static void BuildIndex(int itemID)
        {
            var db = new StockoutEntities();
            var repository = new StockoutRepository();

            foreach (var storeId in db.Stores.Select(s => s.ID))
            {
                var stockouts = GetStockOutHistory(itemID, storeId);
                if (stockouts.Count > 0)
                    repository.AddRange(stockouts);

             }
        }