To create a list you can use the Native API or the Fluent API.
When creating a list, you must perform the following:
Create new list.
First, you must create new list.
Set the required properties.
When creating a new list, it is recommended to set at least the following properties:
Title
Description
UrlName
DateCreated
You can also set any other properties in this step.
Save the list.
Save all changes that you have made to the list.
To create a list using the Native API, you must use the ListsManager class. For more information, see Creating a list using Native API.
To create a list using the Fluent API, you must use the list facade. For more information, see Creating a list using Fluent API.
The examples below show you how to create list with predefined ID.
The following code creates a list with the specified ID, Title and Description through the Native API.
First, you initialize the ListsManager. You create the list using the CreateList method of the ListsManager class. Note that you can create a list with either predefined or auto-generated ID depending on which overload of the method you use. Then, you set the properties of the list. It is recommended to set at least the following properties: Title, Description, UrlName and DateCreated. Finally, you save the changes.
The following code creates a list with the specified ID, Title and Description through the Fluent API.
First, you initialize the singular facade of the list by calling App.WorkWith().List(). You create the list using the CreateNew method of the facade. Then, you set the properties of the list by calling the Do method of the facade. It is recommended to set at least the following properties: Title, Description, UrlName and DateCreated. 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.
This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.
This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. Configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.
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.
To submit feedback, please update your cookie settings and allow the usage of Functional cookies.
Your feedback about this content is important