public IHttpActionResult PostvProductModelCatalogDescription(vProductModelCatalogDescription vProductModelCatalogDescription) { if (!ModelState.IsValid) { return BadRequest(ModelState); } db.vProductModelCatalogDescriptions.Add(vProductModelCatalogDescription); try { db.SaveChanges(); } catch (DbUpdateException) { if (vProductModelCatalogDescriptionExists(vProductModelCatalogDescription.ProductModelID)) { return Conflict(); } else { throw; } } return CreatedAtRoute("DefaultApi", new { id = vProductModelCatalogDescription.ProductModelID }, vProductModelCatalogDescription); }
public IHttpActionResult PutvProductModelCatalogDescription(int id, vProductModelCatalogDescription vProductModelCatalogDescription) { if (!ModelState.IsValid) { return BadRequest(ModelState); } if (id != vProductModelCatalogDescription.ProductModelID) { return BadRequest(); } db.Entry(vProductModelCatalogDescription).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!vProductModelCatalogDescriptionExists(id)) { return NotFound(); } else { throw; } } return StatusCode(HttpStatusCode.NoContent); }