public async Task <IHttpActionResult> Post([FromBody] ConferenceModels conference) { using (ApplicationDbContext db = new ApplicationDbContext()) { db.Conference.Add(conference); await db.SaveChangesAsync(); } return(Ok()); }
public async Task <IHttpActionResult> Put(int id, [FromBody] ConferenceModels conference) { using (ApplicationDbContext db = new ApplicationDbContext()) { if (id != conference.Id) { return(BadRequest()); } db.Entry(conference).State = EntityState.Modified; await db.SaveChangesAsync(); } return(Ok()); }