How to write in LINQ

Posted by Self-Innovator under LINQ on 4/26/2016 | Points: 10 | Views : 1529 | Status : [Member] | Replies : 1
How to write the below statement in LINQ

XmlNode userNode = resultNode.SelectSingleNode("generalinfo", nsmgr);
if (userNode != null)
{
genInfoViewModel.StartDate = userNode.Attributes["effectivedate"] != null ? userNode.Attributes["effectivedate"].Value : string.Empty;
genInfoViewModel.TotRetailSquareFeet = userNode.Attributes["retailsqft"] != null ? userNode.Attributes["retailsqft"].Value : string.Empty;
genInfoViewModel.TotalSquareFeet = userNode.Attributes["totalsqft"] != null ? userNode.Attributes["totalsqft"].Value : string.Empty;
genInfoViewModel.CityPopulation = userNode.Attributes["citypopulation"] != null ? userNode.Attributes["citypopulation"].Value : string.Empty;
genInfoViewModel.GunLicense = userNode.Attributes["gunlicense"] != null ? userNode.Attributes["gunlicense"].Value : string.Empty;
genInfoViewModel.TaxRegistration = userNode.Attributes["taxregnum"] != null ? userNode.Attributes["taxregnum"].Value : string.Empty;
}


Join Hands Change lives
Thanks & Regards
Straight Edge Society



Responses

Posted by: Amatya on: 4/26/2016 [Member] Silver | Points: 25

Up
0
Down
Challenging to write in LINQ

Feel free to share informations.
mail Id ' adityagupta200@gmail.com
Thanks

Self-Innovator, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response