General information
Category:
Coding, syntax and commands
Title:
Help following code
I am looking at some code in C# and I don't know what it's doing. Can anyone show me the light?
ParentCategoryID == 0 ? "NULL" : ParentCategoryID.ToString()
I assume what's doing is returning "null" if ParentCategoryID equals 0 otherwise converting the ParentCategoryID to a string.
However, I don't understand how this construct works. specifically what is the ? function or the : function.
Thank you,
Paul
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only