public async Task <ActionResult <EventApplyForm> > PostEventApplyForm(EventApplyForm eventApplyForm) { _context.EventApplyForm.Add(eventApplyForm); await _context.SaveChangesAsync(); return(CreatedAtAction("GetEventApplyForm", new { id = eventApplyForm.EventApplyId }, eventApplyForm)); }
public async Task <IActionResult> PutEventApplyForm(int id, EventApplyForm eventApplyForm) { if (id != eventApplyForm.EventApplyId) { return(BadRequest()); } _context.Entry(eventApplyForm).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EventApplyFormExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }