Пример #1
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,Title,url")] ObadiahPdfMessages obadiahPdfMessages)
        {
            if (id != obadiahPdfMessages.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(obadiahPdfMessages);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ObadiahPdfMessagesExists(obadiahPdfMessages.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction("Index"));
            }
            return(View(obadiahPdfMessages));
        }
Пример #2
0
        public async Task <IActionResult> Create([Bind("ID,Title,url")] ObadiahPdfMessages obadiahPdfMessages)
        {
            if (ModelState.IsValid)
            {
                _context.Add(obadiahPdfMessages);
                await _context.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(obadiahPdfMessages));
        }