Skip to content

IRehydrationContext Methods

Contains the state of a grain activation which is in the process of being rehydrated after moving from another location.

TryGetBytes(string, ReadOnlySequence<byte>)

abstract
public abstract bool TryGetBytes(string key, out ReadOnlySequence<byte> value)
Tries to get a sequence of bytes from the rehydration context, associated with the provided key.

Parameters

keystring
The key.
valueReadOnlySequence<byte>
The value, if present.

Returns

true if the key exists in the context, otherwise false.

TryGetValue(string, T?)

abstract
public abstract bool TryGetValue<T>(string key, out T? value)
Tries to get a value from the rehydration context, associated with the provided key, deserializing it using Serializer. If a serializer is found for the value, and the key is present, then the value is deserialized and the method returns true. If no serializer exists or the key has already been added, then the value is not added and the method returns false.

Parameters

keystring
The key.
valueT?
The value, if present.

Returns

true if the key exists in the context, otherwise false.