我想在我的服务中使用内存缓存,但无法配置它。我已根据说明在global.asax
注册了它。
以下是我的服务的外观:
public class CustomerSerivce: Service
{
public CustomerResponse Any(Customer customer)
{
//code to connect to db here - this code is called regardless of cache entry
return customer;
}
}
我知道有this.RequestContext.ToOptimized
或其他东西,但有些东西对我不起作用。
提前致谢。