示例#1
0
        public async Task <ActionResult> DeleteConfirmed(long id)
        {
            MockApiHttpData mockApiHttpData = await db.MockApiHttpDatas.FindAsync(id);

            db.MockApiHttpDatas.Remove(mockApiHttpData);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
示例#2
0
        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));
        }
示例#3
0
        // 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));
        }