> 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/api/csharp/yarn/yarn.memoryvariablestore.md).

# MemoryVariableStore

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

Inherits from `System.Object`

## Summary

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

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

## Methods

| Name                                                                                                             | Description                                                                                                                                                                                                                                                                                                                      |
| ---------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Clear()](/api/csharp/yarn/yarn.memoryvariablestore/yarn.memoryvariablestore.clear.md)                           | Removes all variables from storage.                                                                                                                                                                                                                                                                                              |
| [GetVariableKind(string)](/api/csharp/yarn/yarn.memoryvariablestore/yarn.memoryvariablestore.getvariablekind.md) | Gets the kind of variable named `name` .                                                                                                                                                                                                                                                                                         |
| [SetValue(string,bool)](/api/csharp/yarn/yarn.memoryvariablestore/yarn.memoryvariablestore.setvalue-3.md)        | Stores a `bool` in this VariableStorage.                                                                                                                                                                                                                                                                                         |
| [SetValue(string,float)](/api/csharp/yarn/yarn.memoryvariablestore/yarn.memoryvariablestore.setvalue-2.md)       | Stores a `float` in this VariableStorage.                                                                                                                                                                                                                                                                                        |
| [SetValue(string,string)](/api/csharp/yarn/yarn.memoryvariablestore/yarn.memoryvariablestore.setvalue-1.md)      | Stores a `string` in this VariableStorage.                                                                                                                                                                                                                                                                                       |
| [TryGetValue(string,T?)](/api/csharp/yarn/yarn.memoryvariablestore/yarn.memoryvariablestore.trygetvalue.md)      | Given a variable name, attempts to fetch a value for the variable, either from storage, initial values found in [Program](/api/csharp/yarn/yarn.ivariableaccess/yarn.ivariableaccess.program.md) , or by evaluating a smart variable found in [Program](/api/csharp/yarn/yarn.ivariableaccess/yarn.ivariableaccess.program.md) . |

## Properties

| Name                                                                                                                   | Description                                                                                                                                                                                                              |
| ---------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [Program](/api/csharp/yarn/yarn.memoryvariablestore/yarn.memoryvariablestore.program.md)                               | Gets or sets the Yarn [Program](/api/csharp/yarn/yarn.ivariableaccess/yarn.ivariableaccess.program.md) that stores information about the initial values of variables, and is able to produce values for smart variables. |
| [SmartVariableEvaluator](/api/csharp/yarn/yarn.memoryvariablestore/yarn.memoryvariablestore.smartvariableevaluator.md) | Gets or sets the object to use when evaluating smart variables.                                                                                                                                                          |
