Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I need to iterate through all the columns (default + custom) in Message content type in Discussion list.

i have used this code:

//select a single discussion (in this case, the first one), to view it's contentDiscussion
topic = (Discussion)dc.TeamDiscussion.Single(t => t.Id == 5);

//Get all the replies for the selected discussion
IEnumerable<Message> replies = 
   from reply in dc.TeamDiscussion.ScopeToFolder("/"+topic.Reply+"/"+topic.Title, false)                               
   select (Message)reply;

How can I iterate through the IEnumerable replies? I do not want to use CAML.

Please Suggest best possible way to get the results through LINQ

share|improve this question
    
Did you try foreach (Message reply in replies) { } ? –  Brandon Jul 5 '12 at 13:53
add comment

1 Answer 1

As far as I know, the Discussion list work the following way:

List.Items -> Message ContentType

List.Folders -> Discussion ContentType

So to get the Replies, search in the List.Items.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.