# Sandbox.DataBag

A lightweight, lazily-allocated key/value store for stashing arbitrary typed data on an object.
The backing dictionary isn't created until you store something, so empty bags are essentially free.
Not thread-safe - use it from a single thread (usually the main thread).

- Kind: class
- Namespace: `Sandbox`
- Assembly: `Sandbox.System`
- Modifiers: sealed

## Constructors

- [`DataBag`](/api/Sandbox.DataBag/.ctor)

## Methods

- [`Clear`](/api/Sandbox.DataBag/Clear): Remove everything from the bag.
- [`Get`](/api/Sandbox.DataBag/Get): Get the value stored under `key`, or `fallback` if there's nothing there or it's a different type.
- [`Has`](/api/Sandbox.DataBag/Has): Whether anything is stored under `key`.
- [`Remove`](/api/Sandbox.DataBag/Remove): Remove the value stored under `key`. Returns true if something was removed.
- [`Set`](/api/Sandbox.DataBag/Set): Store a value under `key`, replacing anything already there.
