Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private prepareSaveBatches() {
let batches: any[] = [];
// RowVersion fix
// TODO How about Deleted state?
let modifiedEntities = this.getChanges(null, EntityState.Modified);
modifiedEntities.forEach((entity: any) => {
var rowVersion = entity.RowVersion;
entity.RowVersion = "";
entity.RowVersion = rowVersion;
});
batches.push(modifiedEntities);
/* Aaargh!
* Web API OData doesn't calculate the proper save order
* which means, if we aren't careful on the client,
* we could save a new TodoItem before we saved its parent new TodoList
* or delete the parent TodoList before saving its deleted child TodoItems.
* OData says it is up to the client to save entities in the order
* required by referential constraints of the database.
* While we could save each time you make a change, that sucks.
* So we'll divvy up the pending changes into 4 batches
private prepareSaveBatches() {
let batches: any[] = [];
// RowVersion fix
// TODO How about Deleted state?
let modifiedEntities = this.getChanges(null, EntityState.Modified);
modifiedEntities.forEach((entity: any) => {
var rowVersion = entity.RowVersion;
entity.RowVersion = "";
entity.RowVersion = rowVersion;
});
batches.push(modifiedEntities);
/* Aaargh!
* Web API OData doesn't calculate the proper save order
* which means, if we aren't careful on the client,
* we could save a new TodoItem before we saved its parent new TodoList
* or delete the parent TodoList before saving its deleted child TodoItems.
* OData says it is up to the client to save entities in the order
* required by referential constraints of the database.
* While we could save each time you make a change, that sucks.
* So we'll divvy up the pending changes into 4 batches