Hi,
I'm not sure if this is the right place to ask or not, but I have a question regarding the Linq To NHibernate project.
I have a query along the lines of:
Code:
var query = from question in _sessionManager.OpenSession().Linq<Question>()
where question.Domain.DomainName == domain.DomainName
select question.Subdomain;
Essentially, I have a question class with foreign key references to the Domain and Subdomain classes. I want a list of subdomains, but I need to get them as links thru questions that have links to a given domain. It's fairly straightforward, but I keep getting an error telling me that I can't cast from type Question to type Subdomain.
I fired up a Linq to SQL project pointing at the same schema, and it works fine there, so I'm wondering if this is an unimplemented part of the Linq provider, or if there is an alternative syntax that I should employ?
As a side note, if I return an anonymous type composed of properties of the subdomain, it works fine, so it can figure out all the underlying SQL relationships, but for some reason won't return me the entity itself.
Thanks very much,
Matt