public ActionResult Delete(int? id) { if (!id.HasValue) { return new HttpStatusCodeResult(HttpStatusCode.BadRequest); } Estudante estudante; using (var client = new EstudanteService.EstudanteServiceClient()) { estudante = client.GetById(id.Value).MapTo<Estudante>(); } if (estudante == null) { return HttpNotFound(); } return View(estudante); }
public ActionResult Edit(int?id) { if (!id.HasValue) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Estudante estudante; using (var client = new EstudanteService.EstudanteServiceClient()) { estudante = client.GetById(id.Value).MapTo <Estudante>(); } if (estudante == null) { return(HttpNotFound()); } return(View(estudante)); }