Delete video libraries

This topic explains how to delete video libraries. The examples below show you how to delete all of the available video libraries or how to delete only a specific video library by its ID.

Deleting a single video library

When deleting a specific video library by its ID, you must perform the following:

  1. Get the video library.

    First, get an instance of the video library that corresponds to the specified ID.

  2. Delete the video library.

    Mark the video library to be deleted and save the changes.

The following code deletes a video library by its ID.

Native API

 

First, you get an instance of the LibrariesManager class. Then, you get the video library with the specified ID. To mark the video library to be deleted, you call the DeleteVideoLibrary method of the manager with the instance of the video library as an argument. Finally, you save the changes.

Fluent API

 

First, you get the singular facade of the video library with the specified ID. To mark the video library to be deleted, you call the Deletemethod of the facade. Finally, you call SaveChanges.

Deleting all video libraries

When deleting all video libraries, you must perform the following:

  1. Get all video libraries.

    Get instances of the available video libraries.

  2. Delete each video library.

    Iterate through the collection and delete each video library.

The following code deletes all video libraries.

Native API

 

First, you get an instance of the LibrariesManager class. Then, you get all of the available video libraries. You iterate through the collection and mark each video library to be deleted. Finally, you save the changes.

Fluent API

 

First, you get the plural video libraries facade. To mark each item to be deleted, you call the Delete method of the facade. Finally, you save the changes.

Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.

Web Security for Sitefinity Administrators

The free standalone Web Security lesson teaches administrators how to protect your websites and Sitefinity instance from external threats. Learn to configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.

Foundations of Sitefinity ASP.NET Core Development

The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.

Was this article helpful?