示例#1
0
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            try
            {
                await _shopservice.UpdatePhone(Phone, Phone.PhoneID);
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!_shopservice.CheckExist(Phone.PhoneID))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            _cache.Remove("PhoneKey");
            return(RedirectToPage("/Index"));
        }