2010-02-12 254 views
0

如何映射这个类?NHibernate映射

[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; } 
    } 
} 

此表:

agentId int; 
sourceId int; 
hitsCounter int; 

回答

1

你可以做一个.hbm文件。

也许下面的链接,你是合适的:

NHibernate Mapping