c# - complicated relation fluent nhibernate -


hey all

i'm not sure how map this.


i have got buyer,

buyer can have many buyers.
got contract,

now, each contract buyer have many different buyers..

  public class buyer {     private ilist<buyer> m_buyerlist = new list<buyer>();     public virtual ilist<buyer> buyerslist     {         { return m_buyerlist; }         set { m_buyerlist = value; }     }      public virtual string name { get; set; }     public virtual int id { get; set; }     public virtual string address { get; set; }     public virtual string extraaddress { get; set; }     public virtual string phonea { get; set; }     public virtual string phoneb { get; set; }     public virtual string phonec { get; set; }     public virtual string email { get; set; }     public virtual string fax { get; set; } }   public class contract     {         public virtual buyer mainbuyer { get; set; }         public virtual datetime signeddate { get; set; }     } 

thank guys.

buyer mapping:

  hasmanytomany(x => x.buyerslist)        .parentkeycolumn("parentbuyerid")        .childkeycolumn("buyerid")   

contract mapping:

references(x => x.mainbuyer); 

Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -