public async Task <ActionResult> DeleteConfirmed(int id) { HistMatch histMatch = await db.HistMatches.FindAsync(id); db.HistMatches.Remove(histMatch); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public async Task <ActionResult> Edit([Bind(Include = "id,idUser,idUserMatch,IdEvent,DataCriacao")] HistMatch histMatch) { if (ModelState.IsValid) { db.Entry(histMatch).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(histMatch)); }
public async Task <ActionResult> Create([Bind(Include = "id,idUser,idUserMatch,IdEvent,DataCriacao")] HistMatch histMatch) { if (ModelState.IsValid) { db.HistMatches.Add(histMatch); await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(histMatch)); }
// GET: HistMatches/Edit/5 public async Task <ActionResult> Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } HistMatch histMatch = await db.HistMatches.FindAsync(id); if (histMatch == null) { return(HttpNotFound()); } return(View(histMatch)); }