public async Task <IActionResult> Edit(int id, [Bind("Id,Data")] ReleaseNote releaseNote)
        {
            if (id != releaseNote.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(releaseNote);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ReleaseNoteExists(releaseNote.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction("Index"));
            }
            return(View(releaseNote));
        }
Пример #2
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,ApplicationName,VersionText,DownloadLink,Build,ReleaseDate,StorePrice")] Release release)
        {
            if (id != release.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(release);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ReleaseExists(release.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction("Index"));
            }
            return(View(release));
        }