diff --git a/src/MusicStore/Controllers/AccountController.cs b/src/MusicStore/Controllers/AccountController.cs index a7d717402b..3bc5f3ba08 100644 --- a/src/MusicStore/Controllers/AccountController.cs +++ b/src/MusicStore/Controllers/AccountController.cs @@ -107,9 +107,7 @@ namespace MusicStore.Controllers if (result.Succeeded) { await SignInManager.SignInAsync(user, isPersistent: false, rememberBrowser: false); - //Bug: No helper methods - //return RedirectToAction("Index", "Home"); - return Redirect("/"); + return RedirectToAction("Index", "Home"); } else { @@ -154,9 +152,7 @@ namespace MusicStore.Controllers var result = await UserManager.ChangePasswordAsync(user, model.OldPassword, model.NewPassword); if (result.Succeeded) { - //Bug: No helper method - //return RedirectToAction("Manage", new { Message = ManageMessageId.ChangePasswordSuccess }); - return View(); + return RedirectToAction("Manage", new { Message = ManageMessageId.ChangePasswordSuccess }); } else { @@ -181,8 +177,7 @@ namespace MusicStore.Controllers var result = await UserManager.ChangePasswordAsync(user, model.OldPassword, model.NewPassword); if (result.Succeeded) { - //Bug: No helper method - //return RedirectToAction("Manage", new { Message = ManageMessageId.SetPasswordSuccess }); + return RedirectToAction("Manage", new { Message = ManageMessageId.SetPasswordSuccess }); } else { @@ -203,9 +198,7 @@ namespace MusicStore.Controllers { // Bug: This should call SignInManager.SignOut() once its available this.Context.Response.SignOut(); - //Bug: No helper - //return RedirectToAction("Index", "Home"); - return Redirect("/"); + return RedirectToAction("Index", "Home"); } #region Helpers @@ -246,13 +239,14 @@ namespace MusicStore.Controllers //Bug: https://github.com/aspnet/WebFx/issues/244 returnUrl = string.IsNullOrWhiteSpace(returnUrl) ? "/Home" : returnUrl; //if (Url.IsLocalUrl(returnUrl)) + if(true) { return Redirect(returnUrl); } - //else - //{ - // return RedirectToAction("Index", "Home"); - //} + else + { + return RedirectToAction("Index", "Home"); + } } #endregion diff --git a/src/MusicStore/Controllers/CheckoutController.cs b/src/MusicStore/Controllers/CheckoutController.cs index 39109afd7a..a7cffc1f5d 100644 --- a/src/MusicStore/Controllers/CheckoutController.cs +++ b/src/MusicStore/Controllers/CheckoutController.cs @@ -59,10 +59,8 @@ namespace MusicStore.Controllers // Save all changes db.SaveChanges(); - //Bug: Helper not available - //return RedirectToAction("Complete", - // new { id = order.OrderId }); - return View(); + return RedirectToAction("Complete", + new { id = order.OrderId }); } } catch diff --git a/src/MusicStore/Controllers/ShoppingCartController.cs b/src/MusicStore/Controllers/ShoppingCartController.cs index 9605d8520b..72a4d834ce 100644 --- a/src/MusicStore/Controllers/ShoppingCartController.cs +++ b/src/MusicStore/Controllers/ShoppingCartController.cs @@ -32,7 +32,6 @@ namespace MusicStore.Controllers public IActionResult AddToCart(int id) { - // Retrieve the album from the database var addedAlbum = db.Albums .Single(album => album.AlbumId == id); @@ -45,9 +44,7 @@ namespace MusicStore.Controllers db.SaveChanges(); // Go back to the main store page for more shopping - //Bug: Helper method not available - //return RedirectToAction("Index"); - return View(); + return RedirectToAction("Index"); } // diff --git a/src/MusicStore/Controllers/StoreManagerController.cs b/src/MusicStore/Controllers/StoreManagerController.cs index 2f58e695e0..e63511197f 100644 --- a/src/MusicStore/Controllers/StoreManagerController.cs +++ b/src/MusicStore/Controllers/StoreManagerController.cs @@ -69,9 +69,7 @@ namespace MusicStore.Controllers { db.Albums.Add(album); db.SaveChanges(); - //Bug: RedirectToAction() not available - //return RedirectToAction("Index"); - return Redirect("/"); + return RedirectToAction("Index"); } ViewBag.GenreId = new SelectList(db.Genres, "GenreId", "Name", album.GenreId); @@ -106,9 +104,7 @@ namespace MusicStore.Controllers { db.ChangeTracker.Entry(album).State = EntityState.Modified; db.SaveChanges(); - //Bug: Missing RedirectToAction helper - //return RedirectToAction("Index"); - return Redirect("/"); + return RedirectToAction("Index"); } ViewBag.GenreId = new SelectList(db.Genres, "GenreId", "Name", album.GenreId); ViewBag.ArtistId = new SelectList(db.Artists, "ArtistId", "Name", album.ArtistId); @@ -139,9 +135,7 @@ namespace MusicStore.Controllers // TODO [EF] Replace with EntitySet.Remove when querying attaches instances db.ChangeTracker.Entry(album).State = EntityState.Deleted; db.SaveChanges(); - //Bug: Missing helper - //return RedirectToAction("Index"); - return Redirect("/"); + return RedirectToAction("Index"); } //Bug: Can't dispose db.