NHibernate mapping
How to map this class?
[Serializable]
public class AgentSourceCounter
{
private int agentId;
private IDictionary<int, int> sourceCounters;
protected AgentSourceCounter()
{
}
public AgentSourceCounter(int agentId, Dictionary<int, int> sourceCounters)
{
this.agentId = agentId;
this.sourceCounters = 开发者_如何学CsourceCounters;
}
public virtual int AgentId
{
get { return agentId; }
protected set { agentId = value; }
}
public virtual IDictionary<int, int> SourceCounters
{
get { return sourceCounters; }
set { sourceCounters = value; }
}
}
To this table:
agentId int;
sourceId int;
hitsCounter int;
you can make a .hbm file.
maybe the below link is suitable for you :
NHibernate Mapping
精彩评论