I want to get this output from fluent.nhibernate
<map name="Dict" table="TABLE">
<key column="ID_USER" />
<index-many-to-many column="ID_TABLE" class="TableClass" />
<element column="COL" type="Int32" />
</map>
where the class has:
public class User
{
public virtual IDictionary<TableClass, int> Dict { get; protected set; }
}
The closest I understood:
HasMany(x => x.Dict)
.Table("TABLE")
.KeyColumn("ID_USER")
.AsMap<TableClass>("ID_TABLE")
.Element("COL");
And the conclusion for this:
<map name="Dict" table="TABLE">
<key>
<column name="ID_USER" />
</key>
<index type="TableClass">
<column name="ID_TABLE" />
</index>
<element type="Int32">
<column name="COL" />
</element>
<one-to-many class="Int32" />
</map>
How to delete the last line (marked BUG)?
This is not always necessary (for example, in my example, this is not so)!
source
share