接口签名我有缓存的东西一个简单的接口,它是这样的无法确定功能
public interface ICacheService
{
T Get<T>(string cacheId, Func<T> getItemCallback) where T : class;
}
,这适用于简单的回调函数,但在我来说,我需要添加一些更复杂一点。我认为这是一个匿名类型...
在控制器我注入运行一个查询,这是这样一种服务:
this.queryContainer.Get<ObjectQuery>().Execute(new ObjectParameters(id));
当然这个的,但类型是Func键的不那么如果编译器抱怨说,我尝试使用我的缓存服务。
我需要什么样的接口才能让缓存工作? 理想我想这样做:
this.cachingService.Get<ObjectResult>(id, this.queryContainer.Get<ObjectQuery>().Execute(new ObjectParameters(id)));
它甚至有可能?
任何帮助,非常感谢!
非常感谢
'... Execute(new ObjectParameters(id))。Single()'? – mellamokb 2012-07-25 17:16:32