I'm using a string builder to build some SQL Scripts. I have a few Boolean Properties that I would like to test and then output different text based on true/false. I've you the C# syntax below when assigning a value to a variable, but it isn't working for this particular situation. Any ideas?
What I'm used to doing:
string someText = (dbInfo.IsIdentity) ? "First Option" : "Second Option";
Trying to duplicate the same thing inside a StringBuilder method, but this isn't working..
script.Append("sometext" + (dbInfo.IsIdentity) ? " IDENTITY(1,1)" : "");