85
ASP.NET MVC2에서 나는 OutputCache
과 VaryByParam
속성을 사용합니다. 단일 매개 변수를 사용하여 올바르게 작동하게했지만 메서드에 여러 매개 변수가있을 때 올바른 구문은 무엇입니까?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"를 값으로 씁니다.
링크가 작동하지 않습니다. – Espo
링크가 업데이트되었습니다. :-) – klabranche