I have a CRM FetchXML string. This has a linked entity which means the XML Elements are prefixed with a GUID, such as:
<a_6dd7d25cb0be4150bbaec7c0d2f430c7.lastname>Bob</a_6dd7d25cb0be4150bbaec7c0d2f430c7.lastname>
<a_6dd7d25cb0be4150bbaec7c0d2f430c7.firstname>Bob</a_6dd7d25cb0be4150bbaec7c0d2f430c7.firstname>
<a_6dd7d25cb0be4150bbaec7c0d2f430c7.title name="Mr" formattedvalue="1">1</a_6dd7d25cb0be4150bbaec7c0d2f430c7.title>
I would like to use it in a way similar to this:
List<FetchResult> results =
(from result in xmlDoc.Descendants("result")
select new FetchResult
{
FirstName = result.Element("firstname").Value
}).ToList<FetchResult>();
Obviously this won’t work, so is there anyway I can do a Element.Contains("lastname") or similar?
If not, is there way I can parse this out of my string before hand? Perhaps regex?
Thanks
Should work