nordside
unread,May 30, 2012, 4:59:02 PM5/30/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to fluent-n...@googlegroups.com
Hi,
I found some information to map a dictionary in FNH - but nothings works for me. With this configuration I receive an "Could not determine type for: MyObject, ConsoleApplication1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null, for columns: NHibernate.Mapping.Column(Id)" exception:
I use
FluentNHibernate - 1.3.0.727
NHibernate - 3.3.0.4000
public class MyObject
{
public virtual int Id { get; set; }
public virtual string PropertyString { get; set; }
}
public class MyObjectMap : ClassMap<MyObject>
{
public MyObjectMap()
{
Id(x => x.Id);
Map(x => x.PropertyString);
}
}
public class BigObject
{
public virtual int Id { get; set; }
public virtual string Name { get; set; }
public virtual Dictionary<int, MyObject> DicMyObject { get; set; }
}
public class BigObjectMap : ClassMap<BigObject>
{
public BigObjectMap()
{
Id(x => x.Id);
Map(x => x.Name);
HasMany(x => x.DicMyObject)
.AsMap<MyObject>(
index => index.Column("key").Type<int>(),
element => element.Column("Id").Type<MyObject>())
.Inverse()
.Not.LazyLoad().Table("mybigobjects");
}
}
I hope someone has an idea.
Thanks
nordside