public void ResetCache(long companyId) { _productCacheRepository.Delete(companyId); var products = _productRepository.GetProductsForCacheCrawler(companyId, 0, 100000); List <HashProduct> productCaches = products.Select(variable => new HashProduct(variable)).ToList(); _productCacheRepository.UpsertProductHashCache(companyId, productCaches); _productCacheRepository.IncreateCode(companyId, productCaches.Select(a => a.Id).ToList()); }
public ActionResult DeleteConfirmed(int id) { productRepository.Delete(id); productRepository.Save(); //delete cache item cacheRepository.Delete(id); return(RedirectToAction("Index")); }