Getting a key value in an AttributeCollection using LINQ

I am testing this in LINQPad using the CRM plugin.

enter image description here

What should my request be for it to return the value "address1_addressid"?

+4
source share
2 answers

Maybe something like this

from c in ContactSet where ... select new { address1_addressid = c.Attributes.Contains("address1_addressid") ? c.Attributes["address1_addressid"] : "" } 
+4
source

or simply

 from c in ContactSet where c.FirstName.Equals("SomeFirstName") select c.Address1_AddressId 
+1
source

Source: https://habr.com/ru/post/1403039/


All Articles