public async Task <IActionResult> Edit(int id, [Bind("Id,Name,FullName,English,Alpha2,Alpha3,ISO,Location,LocationPrecise")] DictCountry dictCountry) { if (id != dictCountry.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(dictCountry); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DictCountryExists(dictCountry.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(dictCountry)); }
public async Task <IActionResult> Create([Bind("Id,Name,FullName,English,Alpha2,Alpha3,ISO,Location,LocationPrecise")] DictCountry dictCountry) { if (ModelState.IsValid) { _context.Add(dictCountry); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(dictCountry)); }