NHibernate的3.2映射一對多映射我想學習NHibernate 3.2 built-in mapping by code api
(不流利的NHibernate)。你能幫我繪製這些實體之間的一對多關係嗎?一個被程序代碼
public class Member {
public virtual int Id { get; set; }
public virtual ICollection<Comment> Comments { get; set; }
}
public class Comment {
public virtual int Id { get; set; }
public virtual Member { get; set; }
}
UPDATE:
我映射Id
這樣的:
Id(
t => t.Id,
t => {
t.Generator(Generators.HighLow, g => g.Params(new { max_low = 100 }));
t.Column(typeof(TEntity).Name + "Id");
});
發佈你想要可以幫助我們理解你的問題多一點的XML。 – Rippo 2012-03-05 08:44:45