1

有沒有辦法在outputcache屬性內部進行依賴注入?我可以在返回緩存之前檢查數據庫中的某些內容嗎?ASP.NET MVC中的outputcache過濾器中的依賴注入

[CustomOutputCache(CacheProfile = "Documents")] 
     public virtual ActionResult Scoresheets(int? eventId, int? gameId) 
     { 
+0

最好保持屬性被動,如[這裏]所述(http://blog.ploeh.dk/2014/06/13/passive-attributes/)和[here](http://www.cuttingedge.it /blogs/steven/pivot/entry.php?id=98)。 – Steven

回答