# If Else and Elseif Condition in linq

Hi…

Can you explain the Condition of if, if else and elseif in linq with Example…

Thanks
Shyam

Hello @Shyam_Pragash ,

Regards,
Robin

@Shyam_Pragash

If : This is used to specify the block of expression to be executed if the condition is true

if(Condition1)
{ \\ exp to be executed if condition1 is true
}

If else: Else is used to specify the block of expression to be executed if the condition is false

if(Condition1)
{ \\ exp to be executed if condition1 is true
}
else
{ \\ exp to be executed if condition1 is false
}

Else if : This is used to specify new condition if the condition is false

if(Condition1)
{ \\ exp to be executed if condition1 is true
}
else if(Condition2)
{ \\ exp to be executed if condition2 is true
}

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.