public ActionResult Random() { var randomSub = _subDao.GetRandomSub(); if (randomSub == null) { return(Redirect(Url.Subs())); } return(Redirect(Url.Sub(randomSub.Name))); }
public ActionResult Random() { var randomSubId = _subDao.GetRandomSub(nsfw: _userContext.CurrentNsfw); if (randomSubId == null) { return(Redirect(Url.Subs())); } var randomSub = _subDao.GetSubById(randomSubId.Value); if (randomSub == null) { return(Redirect(Url.Subs())); } return(Redirect(Url.Sub(randomSub.Name))); }