Linq with interface-target cannot query dynamic-component

Description

If target is an interface: Querying a dynamic-component using linq, results in an exception as follows:

System.InvalidCastException : Unable to cast object of type 'NHibernate.Type.ComponentType' to type 'NHibernate.Type.CollectionType'

Example:
var product = (from p in session.Query<IProduct>() where p.Properties["Name"] == "First Product" select p).Single();

See also: https://nhibernate.jira.com/browse/NH-2664

Patch suggestion ist attached.

Environment

None

Attachments

3

Activity

Show:

Alex Zaytsev July 26, 2013 at 7:45 AM

Thanks a lot!

Martin Früh July 26, 2013 at 6:50 AM

Same in vNext.
Test case (TestCase_NH3501.zip) and patch suggestion (VisitorUtil.cs) for vNext updated.

Alex Zaytsev July 25, 2013 at 9:28 PM

Can you please check if this does happen in vNext?

Details

Assignee

Reporter

Labels

Components

Affects versions

Priority

Who's Looking?

Open Who's Looking?
Created July 25, 2013 at 7:53 AM
Updated July 26, 2013 at 7:45 AM
Who's Looking?