I am sure this is a straightforward question but consider the following: I have a reference between company and sector as follows:
public class Company {
pub
Two thoughts: First of all, wouldn't something like this accomplish what you want?
public class Company {
public Guid ID { get; set; }
public Sector Sector { get; set; }
public Guid SectorID {
get { return Section.ID; }
// Really not sure what behavior your setter should have here; Maybe it shouldn't even have one?
set { Sector = new Sector { ID = value }; }
}
}
Second, when you say that the mapping created a column in the DB called Sector_Id, is that in addition to a column that you created named SectorID? If so, you can change the column name so it uses the correct name (here's the documentation for mappings, see a few headings down "Specifying the column name").
Also, are you mapping the SectorID property (eg. "Map(x => x.SectorID, "Sector_Id")")?