public async Task <IActionResult> PutInformalGathering(int id, InformalGathering informalGathering) { if (id != informalGathering.ID) { return(BadRequest()); } _context.Entry(informalGathering).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!InformalGatheringExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <InformalGathering> > PostInformalGathering(InformalGathering informalGathering) { if (informalGathering.EndDate == default) { } _context.InformalGatherings.Add(informalGathering); await _context.SaveChangesAsync(); return(CreatedAtAction("GetInformalGathering", new { id = informalGathering.ID }, informalGathering)); }