Walaa:
I have a console application, inserting a Master ( gemeente ).
static void Main(string[] args)
{
using (DataAccessAdapter adapter = new DataAccessAdapter())
{
GemeenteEntity g = new GemeenteEntity();
g.Id = Guid.NewGuid();
g.Naam = "Roelofsarendsveen";
adapter.SaveEntity(g);
}
}
I'm looking for an event that inserts 30 roads in that master ( gemeente ), as early as possible in the process, but at last in the "onvalidateentitybeforesave" event ( from gemeenteentity).
When I execute my code, the onvalidateentitybeforesave method fires, it seems the wegentity records are inserted, there is no error message, but when I check there are no wegrecords inserted at all. So apparently the new entered records are not recognised by SaveEntity(g).
protected override void OnValidateEntityBeforeSave()
{
if (IsNew)
{
WegEntity w = null;
for (int i = 0; i < 30; i++)
{
w = new WegEntity();
w.AanlegJaar = 1900 + i;
w.Naam = "aanlegjaar:"+i.ToString();
w.Id = Guid.NewGuid();
this.Wegs.Add(w);
}
}
base.OnValidateEntityBeforeSave();
}