E
Eric Falsken
We’re storing our main entity in an insert only table which stores the
history of past revisions, but we’re facing problems with storing this
history as LINQ will only update the entity, and not reinsert it with a
different revision number.
Compounding the issue, we’ve also got an associated table storing properties
for our entities which is not revisioned, but we still want changes to the
children of our entity (additions, changes & removals) reflected in the
properties table when we insert the latest version of our entity.
MainObject{
string Name, //PK
string Path, //PK
int RevisionNum, //PK in DB
EntitySet<ChildObject> Children
}
The main problem right now is that when Updating instances of our
MainObject, we need a new record to be stored in the DB. When we were mapping
the object to insert via a stored proceedure, the ChildObjects weren't being
processed. Once we took out the stored proceedures, everything started
working very nicely.
How can we get LINQ to insert new records as part of the update, but also
handle the child objects nicely?
history of past revisions, but we’re facing problems with storing this
history as LINQ will only update the entity, and not reinsert it with a
different revision number.
Compounding the issue, we’ve also got an associated table storing properties
for our entities which is not revisioned, but we still want changes to the
children of our entity (additions, changes & removals) reflected in the
properties table when we insert the latest version of our entity.
MainObject{
string Name, //PK
string Path, //PK
int RevisionNum, //PK in DB
EntitySet<ChildObject> Children
}
The main problem right now is that when Updating instances of our
MainObject, we need a new record to be stored in the DB. When we were mapping
the object to insert via a stored proceedure, the ChildObjects weren't being
processed. Once we took out the stored proceedures, everything started
working very nicely.
How can we get LINQ to insert new records as part of the update, but also
handle the child objects nicely?