I'm somewhat new to C#, an someone explain to me the second ViewBag line?
public ActionResult Index(string sortOrder)
{
ViewBag.NameSortParm = String.IsNullOrEmpty(sortOrder) ? "name_desc" : "";
ViewBag.DateSortParm = sortOrder == "Date" ? "date_desc" : "Date";
.....
}
This is for a sort order from a tutorial and it works, the first line I get, but I have no idea how the second line works in conjunction.
Thanks
EDIT: My question wasn't about the ternary statement, I thought the sortOrder was also being reassigned instead of just the ViewBag.DateSortParm, which would have caused an issue, but that is not the case, I was just blinded for some reason.