I'm having trouble persisting primitive type collection using (Fluent)NHibernate.
Here's the entity and mapping:
public class SomeOne
{
public virtual long ID { get; set; }
public virtual string Name { get; set; }
public virtual string Description { get; set; }
public virtual Iesi.Collections.Generic.ISet<string> Foo { get; protected set; }
public SomeOne()
{
Foo = new HashedSet<string>();
}
}
public SomeOneMap()
{
Id(x => x.ID).GeneratedBy.Identity();
Map(x => x.Name);
Map(x => x.Description);
HasMany(x => x.Foo).Element("Code").AsSet().Not.Inverse();
Table("SomeTypeOne");
}
However, when I try to save SomeOne instance, associated Foo strings get's ignored.
var session = factory.OpenSession();
var one = new SomeOne();
one.Foo.Add("Dato");
one.Foo.Add("Mari");
session.Save(one);
Any idea what could be wrong? Thanks
UPDATE
Here's db schema. it's generated by NH.