> For the complete documentation index, see [llms.txt](https://tariksavas.gitbook.io/tarject/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/tarject/docs/how-to-use/binding-options/withid.md).

# WithId

It is used to specify a binded object according to its id. In this way, more than one object from the same class can be binded with different ids. While injecting, the object is resolved according to the specified id.

Sample uses:

```csharp
public class AppInstaller : GameObjectInstaller
{
    public override void Install(DIContainer container)
    {
        container.Bind<InventoryData>().WithId("inventory1");
        container.Bind<InventoryData>().WithId("inventory2");
    }
}
public class FooMono : MonoBehaviour
{
    [Inject("inventory1")]
    private readonly InventoryData _inventoryDataFirst;
    [Inject("inventory2")]
    private readonly InventoryData _inventoryDataSecond;
}
public class Foo
{
    private readonly InventoryData _inventoryDataFirst;
    private readonly InventoryData _inventoryDataSecond;

    public Foo([Inject("inventory1")] InventoryData inventoryDataFirst, [Inject("inventory2")] InventoryData inventoryDataSecond)
    {
        _inventoryDataFirst = inventoryDataFirst;
        _inventoryDataSecond = inventoryDataSecond;
    }
}
```
