Exemplo n.º 1
0
        public async Task <IActionResult> Edit(int id, Store store)
        {
            if (id != store.idStore)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    await storeBusiness.updateStore(store);
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!await StoreExists(store.idStore))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            await ViewDataAddressesAndCountries();

            return(View(store));
        }