Mapping By-Code support for non-generic User Collection Types

Description

A property with a collection type of for example -> public class MyCollection : PersistentGenericBag<MyEntity> can now be mapped using the Mapping By-Code.

Previously, mapping a non-generic custom collection class which inherits PersistentGenericBag<> or other generic NHibernate collection class, made the ModelMapper throw a NotSupportedException:

"Can't determine collection element relation (property MappedProperty in MyType)"

Root cause for this was the Type extension method DetermineCollectionElementType was not willing to find the element type of a collection type, if the collection type itself wasn't generic. (Even if it did inherit IEnumerable<>)

Environment

None

Activity

Show:

Julian Maughan February 13, 2012 at 2:42 PM

Fixed

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

Who's Looking?

Open Who's Looking?

Created February 10, 2012 at 8:58 PM
Updated September 21, 2014 at 12:42 PM
Resolved June 5, 2012 at 1:49 PM
Who's Looking?