From abd215a5431bd6397efbebf6def4077bbe0bf88c Mon Sep 17 00:00:00 2001 From: Praburaj Date: Tue, 12 Aug 2014 11:44:48 -0700 Subject: [PATCH] Using HttpNotFound helper in actions returning 404 --- src/MusicStore/Controllers/StoreManagerController.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/MusicStore/Controllers/StoreManagerController.cs b/src/MusicStore/Controllers/StoreManagerController.cs index 938c6cfd0c..fb1464f47d 100644 --- a/src/MusicStore/Controllers/StoreManagerController.cs +++ b/src/MusicStore/Controllers/StoreManagerController.cs @@ -41,7 +41,7 @@ namespace MusicStore.Controllers if (album == null) { - return new HttpStatusCodeResult(404); + return HttpNotFound(); } // TODO [EF] We don't query related data as yet. We have to populate this until we do automatically. @@ -84,7 +84,7 @@ namespace MusicStore.Controllers if (album == null) { - return new HttpStatusCodeResult(404); + return HttpNotFound(); } ViewBag.GenreId = new SelectList(db.Genres, "GenreId", "Name", album.GenreId); @@ -117,7 +117,7 @@ namespace MusicStore.Controllers Album album = db.Albums.Single(a => a.AlbumId == id); if (album == null) { - return new HttpStatusCodeResult(404); + return HttpNotFound(); } return View(album); } @@ -143,7 +143,7 @@ namespace MusicStore.Controllers if (album == null) { - return new HttpStatusCodeResult(404); + return HttpNotFound(); } return new ContentResult { Content = album.AlbumId.ToString(), ContentType = "text/plain" };