Hi, I have to search other multiple tables and union the results together. For example say I have the following:
var query1 = session.Query<Page>().Where(p => p.Name.Contains(search)).Select(p => p.Name);
var query2 = session.Query<Category>().Where(c => c.Name.Contains(search)).Select(c => c.Name);
var results = query1.Union(query2).Take(5);
One solution is to execute each query individually and then do the union/concat in memory but this isn't efficient when a single query returns back thousands of results.
I was wondering how hard it would be to enable it for NHibernate? If it's difficult then I guess I'll just scrap the idea and wait until one of you clever people implements it.
Thanks
Lee