I use this in my opinion and want it to display only "Yes" or "No", but its display is False?"yes":"No"
False?"yes":"No"
@myPosts.Contains(item.ID)?"Yes":"No"
What is wrong here?
You need parentheses to express:
@(myPosts.Contains(item.ID)?"Yes":"No")
You can even get a shorthand if inside another shorthand, if!
@(myPosts != null ? (myPosts.Contains(item.ID) ? "Yes" : "No") : "Null")