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

…衆ロ難τιáo~ 提交于 2020-02-10 03:24:08

问题


Func is a serializable class, but yet when I try to pass it as a parameter through a service. I'm told it "isn't a known type". I've tried the solutions here to no avail.

Many thanks out there...


回答1:


There's work happening to enable it. Check out the Expression Tree Serialization project on the MSDN Code Gallery.




回答2:


No, basically. You can't pass an Expression either, since it talks to MemberInfo nodes. Your best bet is a string representation of the predicate.



来源:https://stackoverflow.com/questions/567316/can-you-pass-funct-bool-through-a-wcf-service

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!