Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Conditional or in C#

Tags:

c#

I've been programming in JAVA and C all my years at Uni, but now I'm learning C# and building a small application, and I've found troubles with this:

if (taxonType.Equals(null) ¦¦ taxonID == -1)

I get a red underline for this conditional, and I don't really know why, because according to what I've seen that should be ok, but it is not. Is there something I'm missing?

thank you all in advance, Victor


Thank you all!!! I was getting mad about this. The thing is that I'm Spanish and I'm used to have the pipe key | exactly in the same place where ¦ is in the American configuration... I was seeing this ¦ strange, but I thought it was the same...

Thanks for the fast reply!! Victor

like image 557
vikitor Avatar asked Mar 23 '10 10:03

vikitor


3 Answers

if (taxonType == null || taxonID == -1)

Modified for correct code as well as answering the question asked

like image 192
rrrr-o Avatar answered Nov 08 '22 16:11

rrrr-o


What is '¦'? Are you sure it is the same character as '|'?

like image 26
Marek Avatar answered Nov 08 '22 16:11

Marek


I don't know the types of taxonType and taxonID but it should work like this:

if (taxonType == null || taxonID == -1) 
like image 4
Klaus Byskov Pedersen Avatar answered Nov 08 '22 16:11

Klaus Byskov Pedersen