# GetPropertyBag

> Gets an interface to the PropertyBag<TContainer> for the given type.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Properties](/engine/6000.0/script-reference/unity/properties.md)
* **Assembly:** UnityEngine.PropertiesModule

## GetPropertyBag(Type)

Gets an interface to the [PropertyBag\<TContainer>](/engine/6000.0/script-reference/unity/properties/propertybag1.md) for the given type.

```csharp
public static IPropertyBag GetPropertyBag(Type type)
```

### Parameters

**** (\[Type]\(https\://learn.microsoft.com/dotnet/api/system.type)): The container type to resolve the property bag for.

### Returns

| Type                                                                             | Description                |
| -------------------------------------------------------------------------------- | -------------------------- |
| [IPropertyBag](/engine/6000.0/script-reference/unity/properties/ipropertybag.md) | The resolved property bag. |

### Remarks

The returned [IPropertyBag](/engine/6000.0/script-reference/unity/properties/ipropertybag.md) can be used to get the strongly typed generic using the [IPropertyBagAccept](/engine/6000.0/script-reference/unity/properties/ipropertybag/accept.md) interface method.

## GetPropertyBag\<T>()

Gets the strongly typed [PropertyBag\<TContainer>](/engine/6000.0/script-reference/unity/properties/propertybag1.md) for the given `TContainer`.

```csharp
public static IPropertyBag<TContainer> GetPropertyBag<TContainer>()
```

### Returns

| Type                                                                                 | Description                                |
| ------------------------------------------------------------------------------------ | ------------------------------------------ |
| [IPropertyBag\<T>](/engine/6000.0/script-reference/unity/properties/ipropertybag.md) | The resolved property bag, strongly typed. |
