---
title: "AssetLibrary"
description: "AssetLibrary"
url: "https://www.contentstack.com/docs/developers/sdks/content-delivery-sdk/dot-net/reference/assetlibrary"
product: "Contentstack"
doc_type: "guide"
audience:
  - developers
  - admins
version: "current"
last_updated: "2026-09-21"
---

# AssetLibrary

## AssetLibrary

Get all asset from Stack

## SetHeader

To set headers for Contentstack rest calls.

```
using Contentstack.Core; 
using Contentstack.Core.Models;

ContentstackClient stack = new ContentstackClient("api_key", "delivery_token", "environment");
ContentstackCollection<Asset> asset = await stack.AssetLibrary().SetHeader("custom_key", "custom_value").FindAll();
```

header name.

header value against given header name.

## RemoveHeader

Remove header key.

```
using Contentstack.Core; 
using Contentstack.Core.Models;

ContentstackClient stack = new ContentstackClient("api_key", "delivery_token", "environment");
ContentstackCollection<Asset> asset = await stack.AssetLibrary("asset_uid").RemoveHeader("header_to_remove").FindAll();
```

key to be remove from header

## SortWithKeyAndOrderBy

Sorts the assets in the given order on the basis of the specified field.

```
using Contentstack.Core; 
using Contentstack.Core.Models;

ContentstackClient stack = new ContentstackClient("api_key", "delivery_token", "environment");
ContentstackCollection<Asset> asset = await stack.AssetLibrary().SortWithKeyAndOrderBy("field_uid", "order").FindAll();
```

Field UID

ordering for sorting from key

## SetLocale

Sets the locale.

```
using Contentstack.Core; 
using Contentstack.Core.Models;

ContentstackClient stack = new ContentstackClient("api_key", "delivery_token", "environment");
ContentstackCollection<Asset> assets = await stack.AssetLibrary().SetLocale("en-us").FetchAll();
```

Locale to be fetch

## Skip

The number of objects to skip before returning any.

```
using Contentstack.Core; 
using Contentstack.Core.Models;

ContentstackClient stack = new ContentstackClient("api_key", "delivery_token", "environment");
ContentstackCollection<Asset> assets = await stack.AssetLibrary().Skip(20).FetchAll();
```

No of objects to skip from returned objects.

## Limit

A limit on the number of objects to return.

```
using Contentstack.Core; 
using Contentstack.Core.Models;

ContentstackClient stack = new ContentstackClient("api_key", "delivery_token", "environment");
ContentstackCollection<Asset> assets = await stack.AssetLibrary().Limit(20).FetchAll();
```

No of objects to limit.

## IncludeBranch

Include branch for publish content.

```
using Contentstack.Core; 
using Contentstack.Core.Models;

ContentstackClient stack = new ContentstackClient("api_key", "delivery_token", "environment");
ContentstackCollection<Asset> assets = await stack.AssetLibrary().IncludeBranch().FindAll();
```

## IncludeCount

This method also includes the total number of assets returned in the response.

```
using Contentstack.Core; 
using Contentstack.Core.Models;

ContentstackClient stack = new ContentstackClient("api_key", "delivery_token", "environment");
ContentstackCollection<Asset> assets = await stack.AssetLibrary().IncludeCount().FindAll();
```

## IncludeFallback

Include fallback locale publish content, if specified locale content is not publish.

```
using Contentstack.Core; 
using Contentstack.Core.Models;

ContentstackClient stack = new ContentstackClient("api_key", "delivery_token", "environment");
ContentstackCollection<Asset> assets = await stack.AssetLibrary().IncludeFallback().FindAll();
```

## IncludeMetadata

The includeMetadata method will add the meta information to the response.

```
using Contentstack.Core; 
using Contentstack.Core.Models;

ContentstackClient stack = new ContentstackClient("api_key", "delivery_token", "environment");
ContentstackCollection<Asset> assets = await stack.AssetLibrary().IncludeMetadata().FindAll();
```

## Except

Specifies list of field uids that would be excluded from the response.

```
using Contentstack.Core; 
using Contentstack.Core.Models;

ContentstackClient stack = new ContentstackClient("api_key", "delivery_token", "environment");
AssetLibrary assetLibrary = await stack.AssetLibrary().Except(new String[]{"name", "description"}).FetchAll();
```

## Only

Specifies an array of 'only' keys in BASE object that would be 'included' in the response.

```
using Contentstack.Core; 
using Contentstack.Core.Models;

ContentstackClient stack = new ContentstackClient("api_key", "delivery_token", "environment");
AssetLibrary assetLibrary = await stack.AssetLibrary().Only(new String[]{"name", "description"}).FetchAll();
```

## IncludeRelativeUrls

This method includes the relative url of assets.

```
using Contentstack.Core; 
using Contentstack.Core.Models;

ContentstackClient stack = new ContentstackClient("api_key", "delivery_token", "environment");
ContentstackCollection<Asset> assets = await stack.AssetLibrary().IncludeRelativeUrls().FindAll();
```

## FetchAll

Execute a AssetLibrary and Caches its result (Optional)

```
using Contentstack.Core; 
using Contentstack.Core.Models;

ContentstackClient stack = new ContentstackClient("api_key", "delivery_token", "environment");
ContentstackCollection<Asset> assets = await stack.AssetLibrary().FetchAll();
```

## Count

Total count of the asset in specified Stack

```
using Contentstack.Core; 
using Contentstack.Core.Models;

ContentstackClient stack = new ContentstackClient("api_key", "delivery_token", "environment");
AssetLibrary assetLibrary = await stack.AssetLibrary().Count();
```

## Query

AssetLibrary Query allows you to retrieve assets that match specific query criteria, returning a comprehensive list of assets that meet the defined parameters.

```
Example:
using Contentstack.Core; 
using Contentstack.Core.Models;
ContentstackClient stack = new ContentstackClient("api_key", "delivery_token", "environment");

JsonObject queryObject = new JsonObject
{
  { "filename", "image3.png" }
};

ContentstackCollection<Asset> assets = await stack.AssetLibrary().Query(queryObject).FetchAll();

Note:You can also include nested queries as needed, similar to those used in Content Delivery API QueriesJsonObject queryObject = new JsonObject
{
   { "bank_offers.card_type", new JsonObject { ["$ne"] = "Debit Card" } }
};
```

The query contains the parameters needed to fetch assets and supports nested structures when required.

## Tags

The tags method retrieves all assets associated with the specified tag

```
Example:

ContentstackClient stack = new ContentstackClient("api_key", "delivery_token", "environment");
AssetLibrary assetLibrary = stack.AssetLibrary();
assetLibrary.Tags(new string[] {"banner"});
ContentstackCollection<Asset> assets = await assetLibrary.FetchAll();
```

An array of tag strings used to filter assets; returns assets matching any specified tag. If null or empty, no tag filtering is applied.

## AssetLibrary

## AssetLibrary | .NET Delivery SDK | Contentstack

AssetLibrary retrieves all assets from a stack in the .NET Delivery SDK, letting you fetch collections of media files from Contentstack.