Scenario: Entity Framework 4 , POCO templates and Master Detail relation.
Lets say I have a master type like this:
//partial implementation of master entity
partial class Master
{
public void AddDetail(x,y,z)
{
var detail = new Detail()
{
X = x,
Y = y,
Z = z,
};
//add the detail to the master
this.Details.Add(detail);
}
}
If I then add a master instance to my context and commit, the details will not be saved:
var masterObject = new Master();
masterObject.AddDetail(1,2,3);
myContext.MasterSet.AddObject(masterObject);
Is there any way to make the details to be persisted by reachabillity when using POCO templates? Or any other way? the Details collection in the Master entity is a FixUpCollection, so it ought to track the changes IMO.
So, any ideas how to make this work W/O killing the POCO'ness too much?