From b8782ee2bf7de8256c9c6cc1d94e32aa00ef0fab Mon Sep 17 00:00:00 2001 From: Praburaj Date: Tue, 27 May 2014 17:29:19 -0700 Subject: [PATCH] Adding a REST method to the StoreManagerController for automation purpose. Adding this action to get Id of an album given an album name. --- .../Controllers/CheckoutController.cs | 2 -- .../Controllers/StoreManagerController.cs | 17 ++++++++++------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/MusicStore/Controllers/CheckoutController.cs b/src/MusicStore/Controllers/CheckoutController.cs index f25e7bb40e..5e343d3388 100644 --- a/src/MusicStore/Controllers/CheckoutController.cs +++ b/src/MusicStore/Controllers/CheckoutController.cs @@ -22,8 +22,6 @@ namespace MusicStore.Controllers // // GET: /Checkout/ - //Bug: https://github.com/aspnet/WebFx/issues/339 - [HttpGet] public IActionResult AddressAndPayment() { return View(); diff --git a/src/MusicStore/Controllers/StoreManagerController.cs b/src/MusicStore/Controllers/StoreManagerController.cs index df8d478e70..43fa99ade3 100644 --- a/src/MusicStore/Controllers/StoreManagerController.cs +++ b/src/MusicStore/Controllers/StoreManagerController.cs @@ -53,8 +53,6 @@ namespace MusicStore.Controllers // // GET: /StoreManager/Create - //Bug: https://github.com/aspnet/WebFx/issues/339 - [HttpGet] public IActionResult Create() { ViewBag.GenreId = new SelectList(db.Genres, "GenreId", "Name"); @@ -86,8 +84,6 @@ namespace MusicStore.Controllers // // GET: /StoreManager/Edit/5 - //Bug: https://github.com/aspnet/WebFx/issues/339 - [HttpGet] public IActionResult Edit(int id = 0) { Album album = db.Albums.Single(a => a.AlbumId == id); @@ -119,9 +115,6 @@ namespace MusicStore.Controllers // // GET: /StoreManager/Delete/5 - - //Bug: https://github.com/aspnet/WebFx/issues/339 - [HttpGet] public IActionResult Delete(int id = 0) { Album album = db.Albums.Single(a => a.AlbumId == id); @@ -143,5 +136,15 @@ namespace MusicStore.Controllers db.SaveChanges(); return RedirectToAction("Index"); } + + // + // GET: /StoreManager/GetAlbumIdFromName + // Note: Added for automated testing purpose. Application does not use this. + [HttpGet] + public int GetAlbumIdFromName(string albumName) + { + var album = db.Albums.Single(a => a.Title == albumName); + return album.AlbumId; + } } } \ No newline at end of file