I have a tablestructure like this:
Table entity
(
otherEntity_id int // primarykey
id int // primarykey
parent_id int
)
I still haven't found a solution and mapped changed my model to:
public class Entity
{
public OtherEntity Other { get; set; }
// simple int to discriminate different Entity for the same OtherEntity
public int Id { get; set; }
public int ParentId { get; set; }
}
If you are referencing the same column above twice (otherEntity_id) I've seen mappings like this to avoid this sort of error:
References(e => e.Parent).Columns("otherEntity_id", "parent_id")
.Not.Update()
.Not.Insert();
Also when you are running into a problem it is always helpful to show the full error message you are running into.