实体,INT>&词典的LT连贯NHibernate映射; [英] Fluent NHibernate mapping of Dictionary<Entity, int>
本文介绍了实体,INT>&词典的LT连贯NHibernate映射;的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的领域我有一个运输
可访问端点
在某些位置,因此我有以下
In my domain I have a Transport
which can access Endpoints
at certain positions, as such I have the following:
public class Transport
{
public IDictionary<Endpoint, int> AccessPointPosition { get; set; }
}
现在我试图映射 AccessPointPosition
通过的hasMany
和 AsMap
,但我还没有成功地找到任何一个组合传递的功能NHibernate配置。
Now I'm trying to map the AccessPointPosition
through a combination of HasMany
and AsMap
, but I haven't succeeded in finding anything that passes the Fluent NHibernate configuration.
我俯瞰的东西吗?这是不可能的?是否有关于这个问题的任何文档
Am I overlooking something? Is this impossible? Is there any documentation on this subject?
推荐答案
用流利的映射可能是这样的:
The mapping with fluent could be like this:
HasMany(x => x.AccessPointPosition)
// these are most likely by convention
// .Table("tbl_AccessPointPosition")
// .KeyColumn("Transport_id")
// ...
.AsEntityMap("Endpoint_id")
.Element("integer_col", part => part.Type<int>());
其他一些相关的问题:
Some other related questions:
- Fluent nHibernate , IDictionary Confusion
- Mapping Dictionary with entity based key using Fluent Nhibernate
- Search for equivalent Fluent Nhibernate Mapping - Mapping Map as Dictionary
这篇关于实体,INT>&词典的LT连贯NHibernate映射;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文