CSharpTest.Net
RemoveValue Method
See Also  Example Send Feedback Download Help File
CSharpTest.Net.BPlusTree Assembly > CSharpTest.Net.Collections Namespace > TransactionLog<TKey,TValue> Class : RemoveValue Method

token
key

Glossary Item Box

The provided key/value pair was removed in the provided transaction

Syntax

Visual Basic (Declaration) 
Public Sub RemoveValue( _
   ByRef token As TransactionToken, _
   ByVal key As TKey _
) 
C# 
public void RemoveValue( 
   ref TransactionToken token,
   TKey key
)

Parameters

token
key

Example

BPlusTree/BPlusTree.Test/TestTransactionLog.cs

C#Copy Code
using (TempFile tmp = new TempFile())
using (var log = new TransactionLog<int, string>(Options(tmp)))
{
    var token = log.BeginTransaction();
    log.RemoveValue(ref token, 1);
    log.CommitTransaction(ref token);

    var test = new Dictionary<int, string>();
    test.Add(1, null);
    log.ReplayLog(test);

    Assert.AreEqual(0, test.Count);
}
VB.NETCopy Code
Using tmp As New TempFile()
    Using log As var = New TransactionLog(Of Integer, String)(Options(tmp))
        Dim token As var = log.BeginTransaction()
        log.RemoveValue(token, 1)
        log.CommitTransaction(token)

        Dim test As var = New Dictionary(Of Integer, String)()
        test.Add(1, Nothing)
        log.ReplayLog(test)

        Assert.AreEqual(0, test.Count)
    End Using
End Using

Requirements

Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7

See Also

Generated with Document! X 2011 by Innovasys