public async Task <ActionResult> DeleteConfirmed(string id) { EcoPonto ecoPonto = await db.EcoPontos.FindAsync(id); db.EcoPontos.Remove(ecoPonto); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public async Task <ActionResult> Edit([Bind(Include = "Id,Name,URL,Info,Latitude,Longitude,DataRegisto,Tipo")] EcoPonto ecoPonto) { if (ModelState.IsValid) { db.Entry(ecoPonto).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(ecoPonto)); }
// GET: EcoPontos/Delete/5 public async Task <ActionResult> Delete(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } EcoPonto ecoPonto = await db.EcoPontos.FindAsync(id); if (ecoPonto == null) { return(HttpNotFound()); } return(View(ecoPonto)); }