Can anyone help as to why my onetoone properties won't load? I have another project where they work fine, but for some reason in this one neither of my two properties will work.
Mapping:
public class PlayerMap : ClassMap<Player>
{
public PlayerMap()
{
Table("Player");
LazyLoad();
Id(x => x.PlayerId).GeneratedBy.Identity().Column("PlayerId");
HasOne(x => x.Stats).ForeignKey("PlayerId");
HasOne(x => x.Rankings).ForeignKey("PlayerId");
Map(x => x.LastName).Column("LastName");
Map(x => x.FirstName).Column("FirstName");
HasMany(x => x.MatchResults).KeyColumn("PlayerId");
}
}
Properties:
public virtual Stats Stats { get; set; }
public virtual Rankings Rankings { get; set; }
In the database, they are setup with a Foreign Key relationship.
Where am I going wrong?