views:

61

answers:

0

Here is an example of my class:

public class ClassX
{
   private ClassY _y;

   public ClassY PropertyA
   {
      get { return _y ?? (_y = new ClassY(this); }
   }
}

public class ClassY
{
    public virtual string PropertyB { get; set; }
}

My table looks like this:

table ClassX { PropertyB varchar }

So I need PropertyA to be constructed by ClassX, not by NHibernate, so that the 'this' reference can be passed correctly.

How would I map the scenario using Fluent?