I want to define foreign key relationship between two tables using natural keys... By default nhibernate is considering the other column as primary key...
Class A{
public virtual int id {get; set;}
public virtual int username {get; set;}
}
Class B{
public virtual int id {get; set;}
public virtual int username {get; set;}
}
I want to define foreign key relation from class B (col: username) on class A (col:username)
ManyToOne<ClassA>( x=> x.ClassA, map => { map.Column("username"); };
Nhibenate is creating it on username to id and not on username to username.. how can i achieve this?
Thanks, mayur