public async Task <IActionResult> Edit(decimal id, [Bind("ID,BASEADDRESS")] SampleStreet sampleStreet) { if (id != sampleStreet.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(sampleStreet); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SampleStreetExists(sampleStreet.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(sampleStreet)); }
public async Task <IActionResult> Create([Bind("ID,BASEADDRESS")] SampleStreet sampleStreet) { if (ModelState.IsValid) { _context.Add(sampleStreet); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(sampleStreet)); }