I'm having problem in my conversion of a case statement from VB.Net to C# and need some help. I'm not reading the right material or I'm missing something somewhere . . .
Here is what I have:
switch (true)
{
//Case strRequesterEmail <> "" And strAssigneeEmail <> ""
case !string.IsNullOrEmpty(strRequesterEmail) & (strAssigneeEmail != "donotreply@dimtpa.com" & !string.IsNullOrEmpty(strAssigneeEmail)):
objMessage.To.Add(strRequesterEmail);
objMessage.To.Add(strAssigneeEmail);
break;
case !string.IsNullOrEmpty(strRequesterEmail):
objMessage.To.Add(strRequesterEmail);
break;
case !string.IsNullOrEmpty(strAssigneeEmail):
objMessage.To.Add(strAssigneeEmail);
break;
default:
objMessage.To.Add(BuildUserList(1));
break;
}
I'm getting an error message of "A constant value is expected" at
!string.IsNullOrEmpty(strRequesterEmail)
- I tried
!(string.IsNullOrEmpty(strRequesterEmail))
- but that didn't help