public IHttpActionResult PostCountry_State_City_View(Country_State_City_View country_State_City_View) { if (!ModelState.IsValid) { return BadRequest(ModelState); } db.Country_State_City_View.Add(country_State_City_View); try { db.SaveChanges(); } catch (DbUpdateException) { if (Country_State_City_ViewExists(country_State_City_View.Country_ID)) { return Conflict(); } else { throw; } } return CreatedAtRoute("DefaultApi", new { id = country_State_City_View.Country_ID }, country_State_City_View); }
public IHttpActionResult PutCountry_State_City_View(int id, Country_State_City_View country_State_City_View) { if (!ModelState.IsValid) { return BadRequest(ModelState); } if (id != country_State_City_View.Country_ID) { return BadRequest(); } db.Entry(country_State_City_View).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!Country_State_City_ViewExists(id)) { return NotFound(); } else { throw; } } return StatusCode(HttpStatusCode.NoContent); }