阅读背景:

根据在数据库中找到的日期修改输出缓存

来源:互联网 

I know I can create a custom outputcache attribute for ASP.NET MVC controller action. I would like to change the duration of the output cache depending on if an event has passed or not. If it has passed the current date then the duration would be alot longer. However I need to check a database to do this, however I am making the same call within the controller action itself. Is there anyway to set the duration at the end of the action result so it's dependent on the date of the event that was queried inside the controller action? I dont want to make two calls, one in the output cache attribute and controller action.I know I can create a custom outputcache attrib




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: