我有一个VS2010解决方案,其中包括几个Windows服务项目.我需要将这些服务部署为Team Build 2010中的构建的一部分,并且必须在多台Windows Server计算机上部署Windows服务.
我怎样才能做到这一点?
我有一个字典,我想根据不同的条件进行过滤,例如
IDictionary<string, string> result = collection.Where(r => r.Value == null).ToDictionary(r => r.Key, r => r.Value);
Run Code Online (Sandbox Code Playgroud)
我想将Where子句作为参数传递给执行实际过滤的方法,例如
private static IDictionary<T1, T2> Filter<T1, T2>(Func<IDictionary<T1, T2>, IDictionary<T1, T2>> exp, IDictionary<T1, T2> col)
{
return col.Where(exp).ToDictionary<T1, T2>(r => r.Key, r => r.Value);
}
Run Code Online (Sandbox Code Playgroud)
但是,这不会编译.
我试图通过使用调用此方法
Func<IDictionary<string, string>, IDictionary<string, string>> expression = r => r.Value == null;
var result = Filter<string, string>(expression, collection);
Run Code Online (Sandbox Code Playgroud)
我究竟做错了什么?