StateServerKeyListItem Property

ScaleOut Software NamedCache API
Gets the StateServerKey element at the specified index.

Namespace:  Soss.Client
Assembly:  soss_svcdotnet (in soss_svcdotnet.dll) Version: (

public StateServerKey this[
	int index
] { get; set; }


Type: SystemInt32
The index of the element to get.

Return Value

Type: StateServerKey
the StateServerKey element at the specified index.

To access the object corresponding to a StateServerKey, you should use one of the DataAccessor factory methods (e.g. CreateDataAccessor(StateServerKey)) to create an appropriately initialized DataAccessor or DataAccessor subclass instance. You may then use the returned instance to read and/or update the object. For example:
IndexCollection indexValues = new IndexCollection();
indexValues[2] = new IndexValue("GOOG");
QueryResult qr = Query(indexValues);
foreach (StateServerKey key in qr) {
    // Use the DataAccessor factory method to create a 
    // DataAccessor from the key. Note that by default, 
    // LockWhenReading will be set to true on the 
    // newly-created DataAccessor.
    DataAccessor da = DataAccessor.CreateDataAccessor(key);
    // Read the contents of the object in from StateServer.
    // When the read completes, the object will be locked.
    MyObject myObject = (MyObject) da.ReadObject();
        ... peform some operation(s) on myObject ...
    da.Update(myObject); // releases the lock
See Also