Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save tugberkugurlu/857fcd1f53f35f77108e08dd061b7525 to your computer and use it in GitHub Desktop.
Save tugberkugurlu/857fcd1f53f35f77108e08dd061b7525 to your computer and use it in GitHub Desktop.
From f629b295fc8f9bbd44904284cb0ec832d51185be Mon Sep 17 00:00:00 2001
From: Tugberk Ugurlu
Date: Tue, 30 Apr 2019 09:55:44 +0100
Subject: [PATCH] cache invalidation, imperatively
---
postsharp/0-caching/1-sample-web/Startup.cs | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/postsharp/0-caching/1-sample-web/Startup.cs b/postsharp/0-caching/1-sample-web/Startup.cs
index ec95d1e..8ee6652 100644
--- a/postsharp/0-caching/1-sample-web/Startup.cs
+++ b/postsharp/0-caching/1-sample-web/Startup.cs
@@ -67,6 +67,10 @@ namespace _1_sample_web
return NotFound();
}
+ CachingServices.Invalidation.Invalidate(
+ typeof(CarsContext).GetMethod(nameof(CarsContext.GetAll)),
+ _carsCtx);
+
return Ok(car);
}
--
2.20.1 (Apple Git-117)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment