public async Task <IActionResult> Create([Bind("Id,Pergunta,RespostaEx2")] Exec2 exec2) { ModelState.Clear(); var x = exec2.Pergunta; exec2.RespostaEx2 = $"Seu nome é: {x}"; if (ModelState.IsValid) { _context.Add(exec2); await _context.SaveChangesAsync(); //Comunicação com a Modal TempData["mssgC"] = "Sucesso!"; return(RedirectToAction(nameof(Index))); } return(View(exec2)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Pergunta,RespostaEx2")] Exec2 exec2) { if (id != exec2.Id) { return(NotFound()); } ModelState.Clear(); var x = exec2.Pergunta; exec2.RespostaEx2 = $"Seu nome é: {x}"; if (ModelState.IsValid) { try { _context.Update(exec2); //Comunicação com a Modal TempData["mssgE"] = "Editado!"; await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!Exec2Exists(exec2.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(exec2)); }
public IAsyncResult BeginExecute(IParameterSetter Params, AsyncCallback callback, object obj) { Exec2 exec = new Exec2(Execute); return(exec.BeginInvoke(Params, callback, null)); }
public IAsyncResult BeginExecute(IParameterSetter Params, AsyncCallback callback, object obj) { Exec2 exec = new Exec2(Execute); return exec.BeginInvoke(Params, callback, null); }