Ejemplo n.º 1
0
        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;
        }
Ejemplo n.º 2
0
 protected virtual void ResetCommandText()
 {
     CachedCommandText = new StringBuilder();
     UpdateSqlGenerator.AppendBatchHeader(CachedCommandText);
     LastCachedCommandIndex = -1;
 }