> ## Documentation Index
> Fetch the complete documentation index at: https://cloudinary.com/documentation/llms.txt
> Use this file to discover all available pages before exploring further.

# .NET asset management

While using Cloudinary, all your images, videos, and other raw files are uploaded to Cloudinary. You can use our [Media Library](https://console.cloudinary.com/console/media_library/search) web interface to browse through and manage your uploaded media assets. In addition, you can use methods from the [Upload](image_upload_api_reference) and [Admin](admin_api) APIs, which offer methods for managing, organizing, and creating media assets.

* **Upload API** methods can be used as needed. 
* **Admin API** methods are rate-limited. 
You can view the number of hourly Admin API requests allowed by your Cloudinary plan in the **Account** page of your Console Settings. 

## Upload API 

In addition to the `upload` method, this API includes methods for:

* [renaming](image_upload_api_reference#rename_method) and [permanently deleting](image_upload_api_reference#destroy_method) individual assets
* adding [tags](image_upload_api_reference#tags_method), [contextual metadata](image_upload_api_reference#context_method) and [structured metadata](image_upload_api_reference#metadata_method) to assets 
* creating new assets such as [text images](image_upload_api_reference#text_method), [archives (zip or tgz)](image_upload_api_reference#generate_archive_method), and [animated images](image_upload_api_reference#multi)
* [modifying existing assets](image_upload_api_reference#explicit_method).

## Admin API

A secure API with methods for managing and organizing your media assets, including:

* [listing](admin_api#get_resources) and [restoring](admin_api#restore_resources) assets
* [bulk asset deleting](admin_api#delete_resources) 
* managing [upload presets](admin_api#upload_presets), [upload mappings](admin_api#upload_mappings), [transformations](admin_api#transformations), and [folders](admin_api#folders)
* [updating existing assets](admin_api#update_details_of_an_existing_resource)
* performing [advanced searches](search_method) on the assets in your product environment
* generating a [usage](admin_api#usage) report

	and [more](admin_api)...

> **INFO**: The default resource type for most API requests is `image`. When working with videos, remember to explicitly set the `resource_type` to `video`.

## Upload API example - delete a single asset

The following .NET example uses the Upload API [Destroy](image_upload_api_reference#destroy) method to delete the video with public ID `sample` from your Cloudinary product environment:

```csharp
var account = new Account(
    "my_cloud_name",
    "my_api_key",
    "my_api_secret");

var cloudinary = new Cloudinary(account);

var deletionParams = new DeletionParams("sample"){
  ResourceType = "video"};
var deletionResult = cloudinary.Destroy(deletionParams); 
```

Sample output:  

```json
{
  "result": "ok"
}
```

> **TIP**: To delete multiple assets use the Admin API [DeleteResources](admin_api#delete_resources) method.

For more Upload API examples in .NET, select the `.NET` tab in the [Upload API](image_upload_api_reference) reference.

## Admin API example - get details of a single asset

The following .NET example uses the Admin API [GetResource](admin_api#get_details_of_a_single_resource_by_public_id) method to return details of the image with public ID `sample` (all details are deserialized into an instance of the `GetResourceResult` class):
  
```csharp
var account = new Account(
    "my_cloud_name",
    "my_api_key",
    "my_api_secret");

var cloudinary = new Cloudinary(account);
var getResult = cloudinary.GetResource("sample");

/*
* RESPONSE (GetResourceResult):
* {
*  "asset_id":"d86882d7788f5d1d702cb63418f082a6",
*  "public_id":"sample",
*  "format":"jpg",
*  "version":1375283820,
*  "resource_type":"image",
*  "type":"upload",
*  "created_at":"2017-07-31T15:16:53Z",
*  "bytes":759100,
*  "width":1920,
*  "height":1200,
*  "url":"http://res.cloudinary.com/.../upload/v1375283820/sample.jpg",
*  "secure_url":"https://res.cloudinary.com/.../upload/v1375283820/sample.jpg",
*  "next_cursor":"fe2b0ab2d84c668edaa38d9a528884c8",
*  "derived":[
*  {
*    "transformation":"w_10/a_10/png",
*    "format":"png",
*    "bytes":432,
*    "id":"e76bf3dcb7bb81aa7f5a34a5a90ed2b3",
*    "url":"http://res.cloudinary.com/.../upload/w_10/a_10/v1375283820/sample.png",
*    "secure_url":"https://res.cloudinary.com/.../upload/w_10/a_10/v1375283820/sample.png"
*  },
*  {
*    "transformation":"w_100",
*    "format":"jpg",
*    "bytes":3434,
*    "id":"94a81bec64d7ac730febfe84595ff23d",
*    "url":"http://res.cloudinary.com/.../upload/w_100/v1375283820/sample.jpg",
*    "secure_url":"https://res.cloudinary.com/.../upload/w_100/v1375283820/sample.jpg"
*  }]
* }
*/
```

For more Admin API examples in .NET, select the `.NET` tab in the [Admin API](admin_api) reference.

## Asynchronous API methods

Each of the methods in the upload and Admin APIs has an asynchronous version for .NET.  To call the asynchronous version of a method, append `Async` to the method name.  
    
For example:

* the `Upload` method becomes `UploadAsync`
* the `Rename` method becomes `RenameAsync`
* the `Destroy` method becomes `DestroyAsync`

The following C# code uses the asynchronous method to upload an image:

```csharp     
var uploadParams = new ImageUploadParams()
{
    File = new FileDescription(@"mypicture.jpg")
};

Task<ImageUploadResult> imageUploadTask = cloudinary.UploadAsync(uploadParams);

var uploadResult = await imageUploadTask;
 ```

> **NOTE**: Asynchronous methods enable asynchronous programming on the client side, so that your main thread is not blocked by tasks that take a long time, and other tasks can run simultaneously (see the [Microsoft .NET Programming Guide](https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/async/index) if you are unfamiliar with asynchronous programming). 

Do not confuse asynchronous methods with the `async` parameter in the upload API, which allows requests to be handled asynchronously by Cloudinary on the server side.

For a full list of the API methods, see the [Upload API Reference](image_upload_api_reference) and [Admin API Reference](admin_api).
   
