开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜