public async Task <IActionResult> PutConference(int id, EventDTO.Conference input) { var conference = await _db.FindAsync <Data.Conference>(id); if (conference == null) { return(NotFound()); } conference.Name = input.Name; await _db.SaveChangesAsync(); return(NoContent()); }
public async Task <ActionResult <ConferenceResponse> > CreateConference(EventDTO.Conference input) { var conference = new Data.Conference { Name = input.Name }; _db.Conferences.Add(conference); await _db.SaveChangesAsync(); var result = new EventDTO.ConferenceResponse { ID = conference.ID, Name = conference.Name }; return(CreatedAtAction(nameof(GetConference), new { id = conference.ID }, result)); }