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