> For the complete documentation index, see [llms.txt](https://tariksavas.gitbook.io/tarsave/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tariksavas.gitbook.io/tarsave/docs/how-to-use/datapersistenceservice/save.md).

# Save

<pre class="language-csharp"><code class="lang-csharp"><strong>bool Save&#x3C;T>(string key, T data)
</strong></code></pre>

**Purpose:** Saves data of type T to a specified file path.&#x20;

**Parameters:**&#x20;

* key: A string that is used to determine the file path.&#x20;
* data: The data to be saved, constrained to reference types (classes).&#x20;

**Return Value:** Returns true if the save operation was successful, false otherwise

```csharp
public void Save()
{
    bool result = _dataPersistenceService.Save("Key", _data);
}
```
