> For the complete documentation index, see [llms.txt](https://docs.yarnspinner.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.yarnspinner.dev/2.0/api/csharp/yarn/yarn.memoryvariablestore.md).

# MemoryVariableStore

Class in [Yarn](/2.0/api/csharp/yarn.md)

Inherits from `System.Object`

## Summary

A simple concrete implementation of [IVariableStorage](/2.0/api/csharp/yarn/yarn.ivariablestorage.md) that keeps all variables in memory.

```csharp
public class MemoryVariableStore : IVariableStorage
```

## Methods

| Name                                                                                                            | Description                                |
| --------------------------------------------------------------------------------------------------------------- | ------------------------------------------ |
| [Clear()](/2.0/api/csharp/yarn/yarn.memoryvariablestore/yarn.memoryvariablestore.clear.md)                      | Removes all variables from storage.        |
| [SetValue(string,bool)](/2.0/api/csharp/yarn/yarn.memoryvariablestore/yarn.memoryvariablestore.setvalue-3.md)   | Stores a `bool` in this VariableStorage.   |
| [SetValue(string,float)](/2.0/api/csharp/yarn/yarn.memoryvariablestore/yarn.memoryvariablestore.setvalue-2.md)  | Stores a `float` in this VariableStorage.  |
| [SetValue(string,string)](/2.0/api/csharp/yarn/yarn.memoryvariablestore/yarn.memoryvariablestore.setvalue-1.md) | Stores a `string` in this VariableStorage. |
| [TryGetValue(string,T)](/2.0/api/csharp/yarn/yarn.memoryvariablestore/yarn.memoryvariablestore.trygetvalue.md)  | Retrieves a value of type `T` by name.     |
