WayneBrantley wrote:
If I do a linq query that ends up with
select new {something = somefield}
you can generate valid sql and execute that just fine...
So, if I have TWO of these queries where the select was exactly the same, you can just put UNION/UNION ALL between them and it will work.
I have worked around this by creating a view....but would just like to point out that I know you can figure out a way to support this - even if limited and really think you need to support this to have a 'full' linq provider.
That is just my opinion to help your product. We are still happily using your product.
It's not that I'm not capable of eventually coming up with a way to do this, it's just that it's very unpractical to add it for the querying api because there's no construct currently which allows this, and secondly, it's not easy to add this inside the query system, as there's no notion of holding off a query, generate another one, append it etc.. It's easier said than done, if it was easy it would already be in the query api.
Of course a special code path might be solving it, but only for one case. Consider a union in a set which is part of a subquery in a where clause
I know it will make things easier, and if I could do things over again I would opt for a 'Query' object instead of the elements we use today, but alas, that's not going to chance now, I'm afraid. I can hack it in but only for the outside projection, which still doesn't really make sense because there are other scenario's for union as well.
'Full' is a reference to all those linq providers out there which say they support linq but actually only do simple selects and some where clauses. There are more linq extension methods which aren't implemented, for example because they don't make sense in a DB context or are impossible to do in a db context. If I recall correctly, the only two things we don't support are union and skipping (a skip call without a take so that they can be used to define a page). For comparison, the EF can't do contains, which IMHO is much more severe than the lack of union ever will be.