public async Task<IHttpActionResult> PostSalonsMainScreenMobile(SalonsMainScreenMobile salonsMainScreenMobile) { if (!ModelState.IsValid) { return BadRequest(ModelState); } db.SalonsMainScreenMobiles.Add(salonsMainScreenMobile); try { await db.SaveChangesAsync(); } catch (DbUpdateException) { if (SalonsMainScreenMobileExists(salonsMainScreenMobile.SalonID)) { return Conflict(); } else { throw; } } return CreatedAtRoute("DefaultApi", new { id = salonsMainScreenMobile.SalonID }, salonsMainScreenMobile); }
public async Task<IHttpActionResult> PutSalonsMainScreenMobile(int id, SalonsMainScreenMobile salonsMainScreenMobile) { if (!ModelState.IsValid) { return BadRequest(ModelState); } if (id != salonsMainScreenMobile.SalonID) { return BadRequest(); } db.Entry(salonsMainScreenMobile).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SalonsMainScreenMobileExists(id)) { return NotFound(); } else { throw; } } return StatusCode(HttpStatusCode.NoContent); }