On Apr 22, 11:30 pm, moebius206 <
nwe...@gmail.com> wrote:
> Yeah, there's some extreme weirdness with Intellisense when trying to
> specify the index and element columns.
>
> Here's an example:
>
> HasMany(x => x.Members)
> .AsMap<string>(index =>
> index.Column("membersKey").Type<string>(),
> element =>
> element.Column("membersValue").Type<string>())
> .Cascade.All();
>
> Hope this helps.
Hmm, still doesn't work:
NHibernate.MappingException : Error mapping generic collection
Xxx.Team.Members: expected 1 generic parameters, but the property type
has 2
at NHibernate.Mapping.Collection.CheckGenericArgumentsLength(Int32
expectedLength)
at NHibernate.Mapping.Bag.get_DefaultCollectionType()
at NHibernate.Mapping.Collection.get_CollectionType()
at NHibernate.Mapping.Collection.get_Type()
at NHibernate.Tuple.PropertyFactory.BuildStandardProperty(Property
property, Boolean lazyAvailable)
at NHibernate.Tuple.Entity.EntityMetamodel..ctor(PersistentClass
persistentClass, ISessionFactoryImplementor sessionFactory)
at
NHibernate.Persister.Entity.AbstractEntityPersister..ctor(PersistentClass
persistentClass, ICacheConcurrencyStrategy cache,
ISessionFactoryImplementor factory)
at
NHibernate.Persister.Entity.SingleTableEntityPersister..ctor(PersistentClass
persistentClass, ICacheConcurrencyStrategy cache,
ISessionFactoryImplementor factory, IMapping mapping)
at
NHibernate.Persister.PersisterFactory.CreateClassPersister(PersistentClass
model, ICacheConcurrencyStrategy cache, ISessionFactoryImplementor
factory, IMapping cfg)
at NHibernate.Impl.SessionFactoryImpl..ctor(Configuration cfg,
IMapping mapping, Settings settings, EventListeners listeners)
at NHibernate.Cfg.Configuration.BuildSessionFactory()
...
I pasted your code directly... why is it trying to map it as a bag?
Rich