Victor
Victor

Reputation: 1

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 = sourceCounters;
    }

    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;

Upvotes: 0

Views: 153

Answers (1)

masoud ramezani
masoud ramezani

Reputation: 22920

you can make a .hbm file.

maybe the below link is suitable for you :

NHibernate Mapping

Upvotes: 1

Related Questions