public async Task <IHttpActionResult> PostBookMarksTrainer_Map(BookMarksTrainer_Map bookMarksTrainer_Map) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.BookMarksTrainer_Map.Add(bookMarksTrainer_Map); try { await db.SaveChangesAsync(); } catch (DbUpdateException) { if (BookMarksTrainer_MapExists(bookMarksTrainer_Map.BookMarksTrainer_MapID)) { return(Conflict()); } else { throw; } } return(CreatedAtRoute("DefaultApi", new { id = bookMarksTrainer_Map.BookMarksTrainer_MapID }, bookMarksTrainer_Map)); }
public async Task <IHttpActionResult> PutBookMarksTrainer_Map(string id, BookMarksTrainer_Map bookMarksTrainer_Map) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != bookMarksTrainer_Map.BookMarksTrainer_MapID) { return(BadRequest()); } db.Entry(bookMarksTrainer_Map).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BookMarksTrainer_MapExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public async Task <IHttpActionResult> GetBookMarksTrainer_Map(string id) { BookMarksTrainer_Map bookMarksTrainer_Map = await db.BookMarksTrainer_Map.FindAsync(id); if (bookMarksTrainer_Map == null) { return(NotFound()); } return(Ok(bookMarksTrainer_Map)); }
public async Task <IHttpActionResult> DeleteBookMarksTrainer_Map(string id) { BookMarksTrainer_Map bookMarksTrainer_Map = await db.BookMarksTrainer_Map.FindAsync(id); if (bookMarksTrainer_Map == null) { return(NotFound()); } db.BookMarksTrainer_Map.Remove(bookMarksTrainer_Map); await db.SaveChangesAsync(); return(Ok(bookMarksTrainer_Map)); }