I keep forgetting the syntax for shorthand of if-then-else.
condition ? expression_for_true : expression_for_false
Example
return (MyBlogPosts.Count() != 0) ? System.IO.File.Create("totalPosts.txt") : false;
I keep forgetting the syntax for shorthand of if-then-else.
condition ? expression_for_true : expression_for_false
Example
return (MyBlogPosts.Count() != 0) ? System.IO.File.Create("totalPosts.txt") : false;