How can i access last approved list-items in linq to sharepoint. Actually I want equivalent of this statement in linq to sharepoint if (item.Versions[index].Level == SPFileLevel.Published)
1 Answer
You could try something like below, its not the actual code for your scenario, its just to get an idea for your requirement.
var posts = new List<Post>();
posts =
(from post in
contextSwitch.GetContext(webUrl).Posts
where post.PublicationLevel ==
SPFileLevel.Published
select post).Take(limit).ToList();
Where, PublicationLevel is as follows,
var item = (SPListItem)listItem;
PublicationLevel = item.Level;
Check the below source link for more details.