在ASP.NET MVC2中,我使用OutputCache
和VaryByParam
属性。我只用一个参数就可以正常工作,但是当方法上有多个参数时,正确的语法是什么?
[OutputCache(Duration=30, VaryByParam = "customerId"]
public ActionResult Index(int customerId)
{
//I've got this one under control, since it only has one parameter
}
[OutputCache(Duration=30, VaryByParam = "customerId"]
public ActionResult Index(int customerId, int languageId)
{
//What is the correct syntax for VaryByParam now that I have a second parameter?
}
如何使用两个参数来缓存页面?是否输入两次添加属性?还是写“ customerId,languageId”作为值?