Is it possible to send a TCriteria to the server from client using Rest?
Do you have an interface for TCriteria (ICriteria)?
Actually if you use the query options in an entity set ($filter, $skip, $top), it behaves more or less like "sending a criteria". Isn't it enough for what you need?
On the client site I must send to the server some parameters.
- Which database connection
- List of Alias for TFetchMode.Eager
- list of filters
With these three parameters can I chose the database, force the lazy-loading with eager mode and make my selection.
I'm using the datasnap on the server end TDSRestConnection on the client.
I was thinking to use the TCriteria but I must have a TObjectManager. The TCriteria can do the last 2 params
But I do not use a TObjectManager on the client site, I use the servermethode with DSRestConnection
I did not test the datax or dbremote.
- You should create different XData modules for different database connections. XData module handles the connection pool for you, so you cannot mix the connections. Recommendation is to use a different URL for each db connection2. You can use $expand query option for that3. You can use $filter query option for thatOk, I have now read that you are not using XData... Then it's up to you to make a way to serialize the criteria, send it to the other side, and deserialize it. There is no such feature for using it with DataSnap...
Thanks for the information.