Using .ToDictionary()

后端 未结 7 1968
北荒
北荒 2020-12-25 09:27

I have a method returning a List, let\'s call it GetSomeStrings().

I have an extension method on string class, returning number of characters in the str

7条回答
  •  爱一瞬间的悲伤
    2020-12-25 10:31

    var users = this.context.ad_user.ToDictionary(v => v.DistinguishedName,
    v => new ad_user
    {
         DistinguishedName = v.DistinguishedName,
         CN = v.CN,
         DisplayName = v.DisplayName,
         Info = v.Info,
         Mail = v.Mail
     });
    

提交回复
热议问题