private readonly bool _sortBySortOrder; // default by Title, set to true to use SortORder public LocalList(string listTitle, Func <ISharePointListItem, bool> predicate, bool sortBySortOrder = false) { _logger.Log("Initialise local list: " + listTitle, Type.Information); _predicate = predicate; _sortBySortOrder = sortBySortOrder; Title = listTitle; var listLoader = new ListLoader(); var listItems = new ListItems(); _spListItems = new List <ISharePointListItem>(); try { listItems = listLoader.GetItems(listTitle); _logger.Log($"Loaded {listItems.Count} list items for list {listTitle}", Type.Information); _spListItems = listItems .Select(x => new LocalListItem(x)) .Cast <ISharePointListItem>().ToList(); } catch (Exception ex) { _logger.Log(string.Format("List not loaded {0}, does the list exists and has items? Message: {1}", listTitle, ex.Message), Type.Warning); } }