简体   繁体   English

你能通过Func吗? <T,bool> 通过WCF服务?

[英]Can you Pass Func<T,bool> Through a WCF Service?

Func is a serializable class, but yet when I try to pass it as a parameter through a service. Func是一个可序列化的类,但是当我尝试通过服务将其作为参数传递时。 I'm told it "isn't a known type". 我被告知它“不是一种已知的类型”。 I've tried the solutions here to no avail. 我试过这里的解决方案无济于事。

Many thanks out there... 非常感谢那里......

No, basically. 不,基本上。 You can't pass an Expression either, since it talks to MemberInfo nodes. 您也无法传递Expression ,因为它与MemberInfo节点进行通信。 Your best bet is a string representation of the predicate. 你最好的选择是谓词的字符串表示。

There's work happening to enable it. 正在开展工作以实现它。 Check out the Expression Tree Serialization project on the MSDN Code Gallery. 查看MSDN代码库中的表达式树序列化项目。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM