public async Task <IActionResult> Edit(int id, [Bind("Type, Longtitude, Latitude")] LokasiRumahModel data) { if (id != data.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(data); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DataExsists(data.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(data)); }
public async Task <IActionResult> Create(LokasiRumahModel data) { if (ModelState.IsValid) { _context.Add(data); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(data)); }