0

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 1

0

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.

Source

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.