I want to insert a new entity and set its FK to the related master entity, which already exists.
I don't know the PK value of the master entity,but I know a Unique value of the master entity.
I tried this unsuccessfully
var detailEntity= new detailEntity();
detailEntity.Popis = "Default";
detailEntity.masterEntity= new masterEntity{UniqueField= "XXX",IsNew = false};
and
var masterEntity = new masterEntity();
masterEntity.UniqueField= "XXX";
masterEntity.IsNew = false;
masterEntity.detailEntity.Add(new detailEntity{ Popis = "Default" });
The PK value gets set by a sequence.