public async Task <IActionResult> Edit(string id, [Bind("Id,Temperatura,Umidade")] Incubadora incubadora) { if (id != incubadora.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(incubadora); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!IncubadoraExists(incubadora.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(incubadora)); }
public async Task <IActionResult> Create([Bind("Id,Temperatura,Umidade")] Incubadora incubadora) { if (ModelState.IsValid) { _context.Add(incubadora); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(incubadora)); }