public IHttpActionResult PutCustomerArtistInfo(long id, CustomerArtistInfo customerArtistInfo) { if (!ModelState.IsValid) { return BadRequest(ModelState); } if (id != customerArtistInfo.cust_artist_id) { return BadRequest(); } db.InsertOrUpdate(customerArtistInfo); try { db.Save(); } catch (DbUpdateConcurrencyException) { if (!CustomerArtistInfoExists(id)) { return NotFound(); } else { throw; } } return StatusCode(HttpStatusCode.NoContent); }
public IHttpActionResult PostCustomerArtistInfo(CustomerArtistInfo customerArtistInfo) { if (!ModelState.IsValid) { return BadRequest(ModelState); } db.InsertOrUpdate(customerArtistInfo); db.Save(); return CreatedAtRoute("DefaultApi", new { id = customerArtistInfo.cust_artist_id }, customerArtistInfo); }