C# Linq - Cannot implicitly convert IEnumerable<string> to List<string>

Posted by JL on Stack Overflow See other posts from Stack Overflow or by JL
Published on 2010-05-17T23:28:40Z Indexed on 2010/05/17 23:30 UTC
Read the original article Hit count: 184

Filed under:
|

I have a List defined like this :

public List<string> AttachmentURLS;

I am adding items to the list like this:

instruction.AttachmentURLS = curItem.Attributes["ows_Attachments"].Value.Split(';').ToList().Where(Attachment => !String.IsNullOrEmpty(Attachment));

But I am getting this error: Cannot implicitly convert IEnumerable to List

What am I doing wrong?

© Stack Overflow or respective owner

Related posts about LINQ

Related posts about c#