C# Linq - Cannot implicitly convert IEnumerable to List

后端 未结 3 1759
隐瞒了意图╮
隐瞒了意图╮ 2021-02-18 18:30

I have a List defined like this :

public List AttachmentURLS;

I am adding items to the list like this:

instructio         


        
3条回答
  •  爱一瞬间的悲伤
    2021-02-18 19:07

    The .ToList() should be at last. Because in your code you perform the .ToList() operation earlier and after that again it goes to previous state. The Where method returns an IEnumerable.

提交回复
热议问题