public async Task <IHttpActionResult> PutLimitDateShop(int id, LimitDateShop limitDateShop) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != limitDateShop.Id) { return(BadRequest()); } db.Entry(limitDateShop).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LimitDateShopExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public async Task <IHttpActionResult> GetLimitDateShop(int id) { LimitDateShop limitDateShop = await db.LimitDateShop.FindAsync(id); if (limitDateShop == null) { return(NotFound()); } return(Ok(limitDateShop)); }
public async Task <IHttpActionResult> PostLimitDateShop(LimitDateShop limitDateShop) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.LimitDateShop.Add(limitDateShop); await db.SaveChangesAsync(); return(CreatedAtRoute("DefaultApi", new { id = limitDateShop.Id }, limitDateShop)); }
public async Task <IHttpActionResult> DeleteLimitDateShop(int id) { LimitDateShop limitDateShop = await db.LimitDateShop.FindAsync(id); if (limitDateShop == null) { return(NotFound()); } db.LimitDateShop.Remove(limitDateShop); await db.SaveChangesAsync(); return(Ok(limitDateShop)); }