Allow sub-select SqlExpression in Sql.In clauses
The Load* methods already do this internally (sort-of), but allow explicitly creating Where expressions that use a sub-select to get the IDs, instead of the Sql.In() utility. Or possibly reworking Sql.In to support a Select with a single column.
Something like this:
var customers = Db.From<Customers>().Where( ... my complex expression ... ).Select("Id");
var orders = Db.Select<Orders>(q => Sql.In(q.CustomerId, customers);
3
votes

-
Johann Klemmack commented
Concept wasn't too hard, so I added the basics in PR #450
https://github.com/ServiceStack/ServiceStack.OrmLite/pull/450