/// <summary> /// Create and write the copy operation /// </summary> /// <param name="thingToCopy">The <see cref="Thing"/> to copy</param> /// <param name="targetContainer">The target container</param> /// <param name="keyStates">The <see cref="DragDropKeyStates"/> used in the drag-and-drop operation</param> private async Task WriteCopyOperation(Thing thingToCopy, Thing targetContainer, OperationKind operationKind) { var clone = thingToCopy.Clone(false); var containerClone = targetContainer.Clone(false); var transactionContext = TransactionContextResolver.ResolveContext(targetContainer); var transaction = new ThingTransaction(transactionContext, containerClone); transaction.Copy(clone, containerClone, operationKind); await this.session.Write(transaction.FinalizeTransaction()); }