I am trying to use NHibernate with RIA Services. Currently I have two entities:
public class Person{
[Key]
public virtual int Id {get; set;}
[Include]
[Association("CurrentEmployer", "CurrentEmployerId", "Id", IsForeignKey = true)]
public virtual Employer CurrentEmployer { get;set;}
public virtual int? CurrentEmployerId {get;set;}
}
public class Employer{
[Key]
public virtual int Id {get;set;}
public virtual string Name {get;set;}
}
When I get a person entity through Ria on the client side the CurrentEmployerId
is set but the CurrentEmployer
is still null. On the server side, both the CurrentEmployerId
and the CurrentEmployer
are properly populated. Both the Employer
entity and the Person
entity are exposed in the same Domain Service.
How do I get the CurrentEmployer
to be populated on the client side when I get a person? Am I missing an attribute?