How to get first object out from List<Object> using Linq

前端 未结 10 1354
自闭症患者
自闭症患者 2020-12-29 00:51

I have below code in c# 4.0.

//Dictionary object with Key as string and Value as List of Component type object
Dictionary>         


        
10条回答
  •  情深已故
    2020-12-29 01:28

    There are a bunch of such methods:
    .First .FirstOrDefault .Single .SingleOrDefault
    Choose which suits you best.

提交回复
热议问题