Thanks for the info,
after searching the forum I found a solution:
private static void SaveAppointment(AppointmentsEntity vAppointment)
{
var vGraph = new ObjectGraphUtils();
using (var adapter = new DataAccessAdapter(ConnectionString))
{
var vUnitOfWork = new UnitOfWork2();
foreach (IEntity2 vE in vGraph.ProduceTopologyOrderedList(vAppointment))
{
vE.IsNew = true;
vE.Fields.IsDirty = true;
for (int i = 0; i < vE.Fields.Count; i++)
{
vE.Fields[i].IsChanged = true;
}
vUnitOfWork.AddForSave(vE);
}
vUnitOfWork.Commit(adapter, true);
}
}
Now I have a different problem, I want to set the primary key!!
I don't know if this is even possible but I want to ask if it is possible.
This is my situation:
- I have a master database and a local database, the master database contains all the records of all users, the local database contains only the records of one single user.
The problem is, when using LLBLGen to get an entity (with subentities) from the master database and save this to the local database I should be able to set the primary key (as this is my only reference)
Later on (after updating the local entities) I should be able to re-sync the local entities to the master database, so primary keys should be the same (because all FK-relations should keep working of course)
Shoot! :-)
Grts,
Bert