public IHttpActionResult Delete(int id) { var item = context.GetSingle(id); item.IsDeleted = true; context.Save(); return(Ok()); }
public ActionResult AddImage(Item model, HttpPostedFileBase image1) { if (image1 != null) { model.Image = new byte[image1.ContentLength]; image1.InputStream.Read(model.Image, 0, image1.ContentLength); } context.Add(model); context.Save(); return(View(model)); }