Passing dynamic LINQ queries as part of the message, to be executed on the server

62 views
Skip to first unread message

Christos Delivorias

unread,
Mar 30, 2015, 11:07:33 AM3/30/15
to masstrans...@googlegroups.com
Hey everyone,

This is a questions that's been bothering me for a while to find a nice solution to. I want to be able to construct a dynamic LINQ query on the client-side, construct a request message, send to the RMQ and have the server use EntityFramework mapping to return the results to that query from the db to the client. Has anyone done something similar and can suggest a good solution?
Otherwise, any thoughts as to how to do this, as it's not possible/easy to serialise LINQ queries to send the to the server.

Thanks for any thoughts at all on this.
Christos

Dru Sellers

unread,
Mar 30, 2015, 11:59:30 AM3/30/15
to masstrans...@googlegroups.com
Well, this is a big can of worms. :) 

Running remote code is going to present a crap storm of things to think about. You will most likely want to run it in a restricted and isolated app domain. Now lets assume though for simplicity that we are inside the "circle of trust" - you would need to construct a method to 'serialize' .Net code on the client and send it over the wire. It would then have to be compiled into a dll to run as native LINQ calls. This functionality would not be a part of MT itself, but if you found the right serialization fwk to support it, you should be able to plug it into the MT infrastructure for serialization. 

Another "clunkier" option would be to build up your own representation of a Query much like the NHibernate Criteria that can be serialized. 

Also note that you will be binding yourself to your types across app domains. So if you upgrade one service you could break the other.

As you can probably tell, this is an area that is frought with dragons. So take care. :) 

-d




--
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to masstransit-dis...@googlegroups.com.
To post to this group, send email to masstrans...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/masstransit-discuss/d3b97260-e799-4edb-a5bf-d7c172dee128%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages