public async Task <ActionResult> DeleteConfirmed(long id) { MockApiHttpData mockApiHttpData = await db.MockApiHttpDatas.FindAsync(id); db.MockApiHttpDatas.Remove(mockApiHttpData); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public async Task <ActionResult> Edit([Bind(Include = "Id,Name,Path,Verb,Headers,ResponseStatus,ContentType,ContentEncoding,ResponseBody,ResponseDelay,ApiStatus")] MockApiHttpData mockApiHttpData) { if (ModelState.IsValid) { db.Entry(mockApiHttpData).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(mockApiHttpData)); }
// GET: MockingBird/Delete/5 public async Task <ActionResult> Delete(long?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } MockApiHttpData mockApiHttpData = await db.MockApiHttpDatas.FindAsync(id); if (mockApiHttpData == null) { return(HttpNotFound()); } return(View(mockApiHttpData)); }