Subsonic 3 Union Possible?

不打扰是莪最后的温柔 提交于 2019-12-02 05:54:10

It looks like you're bumping into a bug in SubSonic's implementation of Union/Concat, you should report it to the google code site. You should just be able to do the following, which I'm pretty sure you'd already worked out:

var unionList = dd.Concat(ss).ToList<Menu>();

In the meantime the following should be pretty close to the outer join you're after:

var ss =  from menu in Menu.All()
    group join pages in WebPage.All() on menu2.PageID equals pages.ID
      into pagesMenu from pm in pagesMenu.DefaultIfEmpty()
    group join pagesRoles in PageRole.All() on pages.ID equals pagesRoles.PageID
      into pagesRolesPages from prp in pagesRolesPages.DefaultIfEmpty()
    group join roles in aspnet_Role.All() on pagesRoles.RoleId equals roles.RoleId
      into pagesRolesRoles from prr in pagesRolesRoles.DefaultIfEmpty()
  where menu.PageID == null || 
    (Roles.GetRolesForUser().Contains(roles.RoleName) && menu2.CategoryID == 6)
  select menu;

Yeh, I'm the one that reports the LEFT OUTER JOIN problem. rob told me that the problem is by the Linq parser (Iqueryable provider impl). i think this is major issue because if u can't do more than just basic querys - you can't work with it at all...

so push rob to fix it ASAP. :-).

zahi.

If the SQL queries generated to fill your anonymous types doesn't match, no way: you must do something like this:

dd.ToList().AddRange(ss.ToList());

And of course, this implies double request to your database.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!