Beispiel #1
0
 // GET: Details/5
 public ActionResult Details(int?id)
 {
     try
     {
         Paste paste = dbPastes.Get(id);
         ViewBag.Comments = dbComments.GetAll(id);
         ViewBag.Comments.Reverse();
         ViewBag.Rating = dbRatings.Get(id);
         return(View(paste));
     }
     catch (ArgumentException)
     {
         return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
     }
     catch (KeyNotFoundException)
     {
         return(HttpNotFound());
     }
 }