Expression, EntityField over WCF

Posts   
 
    
methodman
User
Posts: 194
Joined: 24-Aug-2009
# Posted on: 08-Jan-2010 08:17:34   

Are these classes serializable? I'd like to transport them over a namedpipe WCF service.

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 08-Jan-2010 10:21:41   

Both the Expression class and the EntityField2 class have the SerializableAttribute.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39863
Joined: 17-Aug-2003
# Posted on: 08-Jan-2010 10:32:16   

An entityfield is serializable to XML, the expression objects aren't. You're trying to formulate filters and the like and pass them to a WCF service? it might be WCF will serialize the expression object, but will very likely fail when deserializing them.

Frans Bouma | Lead developer LLBLGen Pro
methodman
User
Posts: 194
Joined: 24-Aug-2009
# Posted on: 08-Jan-2010 11:53:17   

I've done some test and it works. I've got thru WCF Expression and EntityField.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39863
Joined: 17-Aug-2003
# Posted on: 08-Jan-2010 12:18:07   

methodman wrote:

I've done some test and it works. I've got thru WCF Expression and EntityField.

Ok simple_smile Not sure if every expression instance will work though, but I think WCF serializes it using the serializer which simply emits types and re-instantiates the types at the other end, so, while that works OK for all public values, it depends if the internal values of the Expression object are also serialized, but if your tests succeed, I'd say, go for it simple_smile (we just didn't implement specific code for this)

Frans Bouma | Lead developer LLBLGen Pro
methodman
User
Posts: 194
Joined: 24-Aug-2009
# Posted on: 08-Jan-2010 12:44:09   

thank you for some clarification about this. I'll observe its behavior.

btw I'm using code from this topic for serialization

http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=16234&StartAtMessage=0&#90670