Kumar AU

Kumar AU

  • 1.4k
  • 309
  • 62k

Need help on LINQ Query C#

Sep 22 2018 7:01 PM
Dear All,
 
I am new to LINQ, I wrote a following code using C#, but I need to rewrite using LINQ, so could you please let me know , how can I rewrite the same.
 
Basicaly I want to achive for all the 0th position in the array I need to set NULL value, for the certin property.
 
Here - OrganizationList is an array.
 
if (OrganizationList.Count > 0)
{
if (OrganizationList[0].OrganizationLevel == 0)
{
OrganizationList[0].NetworkParticipation = null;
OrganizationList[0].ApprovalPolicyID = null;
OrganizationList[0].LastUpdateDate = null;
}
}
 
Please help me

Answers (5)