public async Task <IActionResult> PutGospelUser(int id, GospelUser gospelUser) { if (id != gospelUser.GospelUserId) { return(BadRequest()); } _context.Entry(gospelUser).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!GospelUserExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <GospelUser> > PostGospelUser(GospelUser gospelUser) { _context.GospelUser.Add(gospelUser); await _context.SaveChangesAsync(); return(CreatedAtAction("GetGospelUser", new { id = gospelUser.GospelUserId }, gospelUser)); }