public IActionResult Index(ViewStoreProductModel model = null, ViewOrderDetailsModel x = null) { _logger.LogInformation("AddToCart Controller: PostIndex"); if (!ModelState.IsValid) { return(RedirectToAction("Index", "Home")); } int StoreID = model.StoreID; Store st = _repo.GetAllStores().Where(s => s.StoreID == StoreID).FirstOrDefault(); string storeS = SeriObject(st); TempData["store"] = storeS; ViewStoreDetailModel stor = new ViewStoreDetailModel(); stor.Store = st; if (st == null) { return(RedirectToAction("Index", "Home")); } return(View(stor)); }
public IActionResult Index() { _logger.LogInformation("Home Controller: GetIndex"); foreach (var xx in TempData.Keys) { if (xx != "Logged") { TempData.Remove(xx); } } ViewStoreProductModel Model = new ViewStoreProductModel(); IEnumerable <YourStore.Library.Store> st = _repo.GetAllStores(); Model.Store = st.ToList(); return(View(Model)); }