Exemplo n.º 1
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,MatchId,Contents")] MatchReports matchReports)
        {
            if (id != matchReports.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(matchReports);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!MatchReportsExists(matchReports.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(matchReports));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("Id,MatchId,Contents")] MatchReports matchReports)
        {
            if (ModelState.IsValid)
            {
                _context.Add(matchReports);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(matchReports));
        }