I'm trying to learn NHibernate 3.2 built-in mapping by code api
(NOT Fluent NHibernate). Can you help me to map a one-to-many relationship between these entities please?
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:
I map the Id
like this:
Id(
t => t.Id,
t => {
t.Generator(Generators.HighLow, g => g.Params(new { max_low = 100 }));
t.Column(typeof(TEntity).Name + "Id");
});