Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

c#

.net

wcf

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...

like image 934
KevDog Avatar asked Feb 19 '09 21:02

KevDog


2 Answers

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.

like image 108
Marc Gravell Avatar answered Sep 29 '22 11:09

Marc Gravell


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

like image 43
Matt Hamilton Avatar answered Sep 29 '22 11:09

Matt Hamilton