# DataStore.Result<T>

Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0

<div class="api-meta">
<span class="api-kind api-kind-class" data-pagefind-filter="kind:Class">Class</span>
<span data-pagefind-filter="namespace:Sansar.Simulation">Namespace <a href="/scripting/api/sansar.simulation"><code>Sansar.Simulation</code></a></span>
<span>Inherits <a href="/scripting/api/sansar.utility/jsonserializationdata-1">Sansar.Utility.JsonSerializationData&lt;T&gt;</a></span>
<span class="api-badge api-since">Added in 37.1.0</span>
</div>

<span id="T:Sansar.Simulation.DataStore.Result`1"></span>

Holds the result of operations on a [`DataStore`](/scripting/api/sansar.simulation/datastore).

```csharp
public class DataStore.Result<T> : Sansar.Utility.JsonSerializationData<T>
```

**Type parameters:** `T`: The type of the result.

## Remarks

Properties used my depend on the method called and options. The type used must be able to be serialized with the [`JsonSerializer`](/scripting/api/sansar.utility/jsonserializer).

## Members at a glance

| Kind | Members |
|---|---|
| **Properties** | [Version](#version) |
| **Methods** | [ToString](#tostring) |

## Properties

### Version

<div class="api-card">
<span id="P:Sansar.Simulation.DataStore.Result`1.Version"></span>
<div class="api-badges"><span class="api-badge api-since">Added in 37.1.0</span></div>

```csharp signature
public int Version { get; }
```

Version of the value for the key used for this operation.

**Value:** [int](https://learn.microsoft.com/dotnet/api/system.int32) — An integer version number for the data in the store.

<details class="api-remarks"><summary>Remarks</summary>

Each write to a given key will update this value, even if the same value is written. To ensure that one script is not clobbering writes by another script the [`Options.Version`](/scripting/api/sansar.simulation/datastore.options#version) can verify that the data has not changed.

</details>

</div>


## Methods

### ToString

<div class="api-card">
<span id="M:Sansar.Simulation.DataStore.Result`1.ToString"></span>
<span id="M:Sansar.Simulation.DataStore.Result`1.ToString()"></span>
<div class="api-badges"><span class="api-badge api-since">Added in 37.1.0</span></div>

```csharp signature
public override string ToString()
```

A string representation of this object.

**Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — A string representation of this object.

<details class="api-remarks"><summary>Remarks</summary>

The format of this string may change between releases.

</details>

</div>


## Used in examples

- [DataStoreExample.cs](https://github.com/Wookey-Technologies/sansar-script-starter/blob/66af8b516b701088d043e4615acfcf5779356604/examples/official/DataStoreExample.cs)

<p class="api-generated" data-pagefind-ignore>Generated from the Sansar 47.10.0 client ScriptApi snapshot.</p>