在流畅的nhibernate中映射HasMany或HasManyToMany时,可以指定用于列表的列名作为AsList()方法的参数,如下所示:
HasMany(c => c.Customers)
.AsList(c => c.Column("PositionIndex"));
Run Code Online (Sandbox Code Playgroud)
我希望能够使用Fluent NHibernate约定(预先存在的约定或自定义约定)来设置它,特别是因为默认名称似乎是"索引",它是MSSQL中的保留字.
我尝试使用实现IHasManyConvention的自定义约定,但实例参数似乎不包含有关其列表,包或集的信息,也不包含索引列的列详细信息.
public void Apply(IOneToManyCollectionInstance instance)
{
}
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?
归档时间: |
|
查看次数: |
677 次 |
最近记录: |