using System;
using Telerik.Sitefinity;

namespace SitefinityWebApp
{
    public class ModifyLists_ModifyListFluentAPI
    {
        public void ModifyListFluentAPI(Guid listId, string newTitle)
        {
            int count = 0;

            // Check whether the item exists. 
            App.WorkWith().Lists().Where(l => l.Id == listId).Count(out count);

            if (count > 0)
            {
                // Get the list 
                App.WorkWith().List(listId).Do(l =>
                {
                    // Modify the list 
                    l.Title = newTitle;
                }).SaveChanges();
            }
        }
    }
}