I\'m new to NHibernate and Fluent NHibernate.
Assuming I have a situation like the following
Table Activities (uniquidentier ID, varchar ActivityName)
Ta
Based on your hint, i've come to:
WithTable("Activities");
Id(x => x.Id).ColumnName("ID").GeneratedBy.Guid();
Map(x => x.ActivityName).Not.Nullable().WithLengthOf(50);
HasMany(x => x.ActivityParameters)
.Cascade.Delete()
.KeyColumnNames.Add("ActivityID")
.AsMap("ParameterName")
.AsMap("ParameterValue")
.WithTableName("ActivityParameters");
but i get an error, Association references unmapped class: System.Object. :(
Later edit: I got the latest version of Fluent, and now the code looks like this:
Table("Activities");
Id(x => x.Id).Column("ID").GeneratedBy.Guid();
Map(x => x.ActivityName).Not.Nullable().Length(50);
HasMany(x => x.ActivityParameters)
.KeyColumn("ActivityID")
.ForeignKeyCascadeOnDelete()
.Table("ActivityParameters");