protected virtual void UpdateCachedCommandText(int commandPosition) { var newModificationCommand = ModificationCommands[commandPosition]; switch (newModificationCommand.EntityState) { case EntityState.Added: UpdateSqlGenerator.AppendInsertOperation(CachedCommandText, newModificationCommand); break; case EntityState.Modified: UpdateSqlGenerator.AppendUpdateOperation(CachedCommandText, newModificationCommand); break; case EntityState.Deleted: UpdateSqlGenerator.AppendDeleteOperation(CachedCommandText, newModificationCommand); break; } LastCachedCommandIndex = commandPosition; }
protected virtual void ResetCommandText() { CachedCommandText = new StringBuilder(); UpdateSqlGenerator.AppendBatchHeader(CachedCommandText); LastCachedCommandIndex = -1; }