Skip to content

Commit bf983fd

Browse files
committed
fixed: changing bag to list in convention
1 parent 6c1df20 commit bf983fd

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/FluentNHibernate/Conventions/Instances/CollectionInstance.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,14 @@ void ICollectionInstance.AsBag()
173173
void ICollectionInstance.AsList()
174174
{
175175
mapping.Collection = Collection.List;
176+
if (mapping.Index == null)
177+
{
178+
var indexMapping = new IndexMapping();
179+
var columnMapping = new ColumnMapping();
180+
columnMapping.Set(x => x.Name, Layer.Defaults, "Index");
181+
indexMapping.AddColumn(Layer.Defaults, columnMapping);
182+
mapping.Set(x => x.Index, Layer.Defaults, indexMapping);
183+
};
176184
}
177185

178186
void ICollectionInstance.AsMap()

0 commit comments

Comments
 (0)