public async Task <IHttpActionResult> PutRetail_WebPage(int id, Retail_WebPage retail_WebPage) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != retail_WebPage.PageId) { return(BadRequest()); } db.Entry(retail_WebPage).State = System.Data.Entity.EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!Retail_WebPageExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public async Task <IHttpActionResult> GetRetail_WebPage(int id) { Retail_WebPage retail_WebPage = await db.Retail_WebPage.FindAsync(id); if (retail_WebPage == null) { return(NotFound()); } return(Ok(retail_WebPage)); }
public async Task <IHttpActionResult> PostRetail_WebPage(Retail_WebPage retail_WebPage) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.Retail_WebPage.Add(retail_WebPage); await db.SaveChangesAsync(); return(CreatedAtRoute("DefaultApi", new { id = retail_WebPage.PageId }, retail_WebPage)); }
public async Task <IHttpActionResult> DeleteRetail_WebPage(int id) { Retail_WebPage retail_WebPage = await db.Retail_WebPage.FindAsync(id); if (retail_WebPage == null) { return(NotFound()); } db.Retail_WebPage.Remove(retail_WebPage); await db.SaveChangesAsync(); return(Ok(retail_WebPage)); }