public async Task <IActionResult> PutGospelSharing(int id, GospelSharing gospelSharing) { if (id != gospelSharing.ShareId) { return(BadRequest()); } _context.Entry(gospelSharing).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!GospelSharingExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <GospelSharing> > PostGospelSharing(GospelSharing gospelSharing) { _context.GospelSharing.Add(gospelSharing); await _context.SaveChangesAsync(); return(CreatedAtAction("GetGospelSharing", new { id = gospelSharing.ShareId }, gospelSharing)); }