Hi all,

I have something like this in my code..

I have a Students list.

foreach(var name in Students)
{
if(name.StudentName == "John")
{
//Do Something
}
else(name.StudentName == "ALEX")
{
//Do Something
}
}

Is there any better approach for this?

Thanks,
Genith