Just create two classes as:
public class Person
{
public virtual int PersonId { get; set; }
public virtual string FirstName { get; set; }
public virtual string Surname { get; set; }
}
public class Project
{
public virtual int ProjectId { get; set; }
public virtual string Title { get; set; }
public virtual Person ProjectManager { get; set; }
public virtual Person Contact { get; set; }
}
and a mapping class for Project as it is more interesting than Person :)
public class ProjectMap : ClassMap<Project>
{
public ProjectMap()
{
Id(x => x.ProjectId);
Map(x => x.Title);
References(x => x.ProjectManager);
References(x => x.Contact);
}
}
if you are using FNH
mapping override will be something like:
public class ProjectMappingOverride : IAutoMappingOverride<Project>
{
public void Override(AutoMapping<Project> mapping)
{
mapping.Id(x => x.ProjectId); //Usually for Id I have a convention, and not define it here
mapping.Map(x => x.Title); //Also for simple properties. You could remove these lines if you have setup the conventions.
mapping.References(x => x.ProjectManager);
mapping.References(x => x.Contact);
}
}
Do not forget about Convention other Configuration :)