1

i have the following class:

public class Worker    
{
 public int WorkerID {get;set;}
 public string Name { get;set;}
}

public class TransferOrder
{
  public int TransferOrderID { get;set;}
  public Worker workerTobeTransfered{get;set;}

}

how do i automap this classes in fluent nhibernate.

Nour
  • 5,252
  • 3
  • 41
  • 66

1 Answers1

1

ok, after a few googling, i figured out the solution:

this is a many-to-one relation and it is mapped using Reference() Method, and the auto mapping already do that:

References<Worker>(m => m.Worker);

there is also a great article provide many examples of mapping situations which can be found Here.

Nour
  • 5,252
  • 3
  • 41
  • 66