private static async Task deleteAllItemsFromDatabase(ProductRepository productRepository, ProductInfoRepository productInfoRepository, RecipeRepository recipeRepository, StorageRepository storageRepository) { foreach (var p in await productRepository.GetAllItems()) { if (p != null) { await productRepository.DeleteItem(p.Id); } } foreach (var p in await productInfoRepository.GetAllItems()) { if (p != null) { await productInfoRepository.DeleteItem(p.Id); } } foreach (var p in await recipeRepository.GetAllItems()) { if (p != null) { await recipeRepository.DeleteItem(p.Id); } } foreach (var p in await storageRepository.GetAllItems()) { if (p != null) { await storageRepository.DeleteItem(p.Id); } } }