Created
October 5, 2017 14:26
-
-
Save sitefinitySDK/3b8b7fddde4a28507b89880ff424c136 to your computer and use it in GitHub Desktop.
SF_10.1, SF_10.2, SF_11.0, SF_11.1, SF_11.2, SF_12.0, SF_12.1, SF_12.2, SF_13.0, SF_13.1, SF_13.2, SF_13.3, SF_14.0, SF_14.1, SF_14.2, SF_14.3 - https://docs.sitefinity.com/for-developers-query-list-items
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
using Telerik.Sitefinity.Modules.Lists; | |
using Telerik.Sitefinity.Lists.Model; | |
namespace SitefinityWebApp | |
{ | |
public class QueryListItems_GetListItemByIdNativeAPI | |
{ | |
public ListItem GetListItemByIdNativeAPI(Guid masterListItemId) | |
{ | |
ListsManager listsManager = ListsManager.GetManager(); | |
ListItem listItem = listsManager.GetListItems().Where(i => i.Id == masterListItemId).FirstOrDefault(); | |
if (listItem != null) | |
{ | |
listItem = listsManager.Lifecycle.GetLive(listItem) as ListItem; | |
} | |
return listItem; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment