public async Task<ActionResult> EditListing(AddEditListingViewModel model) { model.LoggedInUser = await storeService.GetCurrentUser(); model.FullNavList = CreateStoreControllerAdminNavList(); if (ModelState.IsValid == false) { return View(model); } storeService.EditListing(model.Listing); return RedirectToAction("AdminListings"); }
public async Task<ActionResult> EditListing(int id) { AddEditListingViewModel model = new AddEditListingViewModel(); model.Listing = storeService.GetListingByID(id); model.LoggedInUser = await storeService.GetCurrentUser(); model.FullNavList = CreateStoreControllerAdminNavList(); return View(model); }