public async Task<IHttpActionResult> PutBinderHistory(long id, BinderHistory binderHistory) { if (!ModelState.IsValid) { return BadRequest(ModelState); } if (id != binderHistory.AuditId) { return BadRequest(); } db.Entry(binderHistory).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BinderHistoryExists(id)) { return NotFound(); } else { throw; } } return StatusCode(HttpStatusCode.NoContent); }
public async Task<IHttpActionResult> PostBinderHistory(BinderHistory binderHistory) { if (!ModelState.IsValid) { return BadRequest(ModelState); } db.BinderHistory.Add(binderHistory); await db.SaveChangesAsync(); return CreatedAtRoute("DefaultApi", new { id = binderHistory.AuditId }, binderHistory); }
// POST: odata/BinderHistories public async Task<IHttpActionResult> Post(BinderHistory binderHistory) { if (!ModelState.IsValid) { return BadRequest(ModelState); } db.BinderHistory.Add(binderHistory); await db.SaveChangesAsync(); return Created(binderHistory); }