public async Task <IHttpActionResult> PostMLX906(MLX906 mLX906) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.MLX906.Add(mLX906); try { await db.SaveChangesAsync(); } catch (DbUpdateException) { if (MLX906Exists(mLX906.Id)) { return(Conflict()); } else { throw; } } return(CreatedAtRoute("DefaultApi", new { id = mLX906.Id }, mLX906)); }
public async Task <IHttpActionResult> PutMLX906(Guid id, MLX906 mLX906) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != mLX906.Id) { return(BadRequest()); } db.Entry(mLX906).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MLX906Exists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public async Task <IHttpActionResult> GetMLX906(Guid id) { MLX906 mLX906 = await db.MLX906.FindAsync(id); if (mLX906 == null) { return(NotFound()); } return(Ok(mLX906)); }
public async Task <IHttpActionResult> DeleteMLX906(Guid id) { MLX906 mLX906 = await db.MLX906.FindAsync(id); if (mLX906 == null) { return(NotFound()); } db.MLX906.Remove(mLX906); await db.SaveChangesAsync(); return(Ok(mLX906)); }