views:

28

answers:

1

Given the following Tables and classes.... I want to know how to Map class Bs reference to A. It doesn't have a direct reference in table B, but comes from A having a reference to it. B only ever has 1 A that will have a reference to it. Can it be done? :)

table A
int id
int bID


table B
int id

class A
{
   virtual int id { get; set;}
   virtual B B { get; set; }
}

class B
{
   virtual int id{get; set;}
   virtual A A { get; set;}
}
A: 

ok figured it out...

in the B mapping... HasOne(x => x.A).PropertyRef("B").Cascade.All();

need the cascade all to make to make it save, without, it doesn't

Keith Nicholas