有人知道WCF是否支持像Web Services一样的缓存,还是应该手动实现?
答案 0 :(得分:0)
我认为您需要在WCF实现类中设置[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]
属性,如
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]
public class MyService: IMyService
{
public void SomeMethod()
{
HttpContext.Current.Cache["someKey"] = "someValue";
}
}