I cannot find an example on this. I'm trying to get a basic understanding of Fluent NHibernate but resources seem quite scarce in terms of proper tutorials.
I have a test class like this:
public class User
{
public virtual long ID { get; set; }
public virtual string Username { get; set; }
public virtual MoreDetails ExtendedDetails { get; set; }
}
With another class like this:
public class MoreDetails
{
public virtual long ID { get; set; }
public virtual string Firstname { get; set; }
public virtual long UserID { get; set; } // Foreign key in the DB
}
What exactly should my mapping look like?
How can I query the DB properly with either Lazy or Eager loading to be able to do this:
// user object instantiated using your provided example:
userObject.ExtendedDetails.Firstname
I feel like an idiot.. normally I can follow documentation but its very vague with this sort of usage. Can anyone point me to a proper example (or give one)?
I'm using the latest Fluent NHibernate straight from the Fluent NHibernate website.
Regards,
chem