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