score:0

what's wrong with

var result= query1.count() > query2.count();

return result; // result is of type bool

edit:

if you really want to execute it as one query on the server, you could use datacontext.executequery to execute a dynamic query.

score:4

try

return query1.count() > query2.count();

it's not worth trying to run two unrelated queries in the same server call, but here it is:

select case when (select count(*) from products) 
        > (select count(*) from orders) 
            then cast(1 as bit) 
            else cast(0 as bit)

however, i seriously doubt you can get linq to create this kind of query. you would have to call a stored procedure instead.


Related Query

More Query from same tag