开发者

Nested select not working in NHibernate.Linq

开发者 https://www.devze.com 2022-12-21 13:02 出处:网络
I want to load the list of users and their roles, with this query: var q = from u in session.Linq<User>()

I want to load the list of users and their roles, with this query:

var q = from u in session.Linq<User>()
    select new
    {
        u.Name,
        u.Password,                                
        Roles = from r in u.Roles
                select new { r.Code, r.Name }
    }; 

But this query is not working. Produce the following error: "The method 'Select' is not implemented."

¿The message suggest that NHibernate.Linq not support nested selects? I want to know if 开发者_如何学Gothis is certain or exist other way to do this?

PD: please excuse my bad english.


Current implementation of Linq provider is based on CriteriaApi and that why it can create only simple queries

0

精彩评论

暂无评论...
验证码 换一张
取 消