public async Task <IActionResult> Edit(string id, [Bind("Id,Name,GroupName,IsActive,Meta")] TransectionType transectionType) { if (id != transectionType.Id) { return(NotFound()); } if (ModelState.IsValid) { try { transectionType.UpdatedBy = GteUserId(); _context.Update(transectionType); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TransectionTypeExists(transectionType.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(transectionType)); }
public async Task <IActionResult> Create([Bind("Name,GroupName,IsActive,Meta")] TransectionType transectionType) { if (ModelState.IsValid) { transectionType.CreatedBy = GteUserId(); _context.Add(transectionType); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(transectionType)); }