Why there is a Visual Studio message about redundant conditional ternary expression usage, when there is a mouse over expression (also expression "true : false" has lower opacity). Does it tell me about i can write somehow less code to get what i want (if ViewBag.CMSClientStatus is equal to "Действующий", then check the radio)?
@Html.RadioButton("ClientStatus", "Real", ViewBag.CMSClientStatus == "Действующий" ? true : false, new { @readonly = true })
Instead of:
Just use:
The equality operator (
==
) already returnstrue
orfalse
, so no need for a conditional operator.