Show / Hide Table of Contents

Storage.Get Method

Returns a value from the persistent store based on the given key.

Namespace: Neo.SmartContract.Framework.Services.Neo

Assembly: Neo.SmartContract.Framework

Syntax

This method has multiple overloads:

public extern byte[] Get(Neo.SmartContract.Framework.Services.Neo.StorageContext context, byte[] key)
public extern byte[] Get(Neo.SmartContract.Framework.Services.Neo.StorageContext context, string key)
public extern byte[] Get(byte[] key)
public extern byte[] Get(string key)

Parameters:

  • Context: Storage context as a StorageContext . If StorageContext is not passed in, CurrentContext is used by default.

  • Key: Key as a byte array or string.

Return Value: The value corresponding to the key as a byte array.

Example

public class Contract1 : SmartContract
{
    public static void Main()
    {
        byte[] value = Storage.Get("contract");
    }
}

Back