示例#1
0
        public IHttpActionResult Delete(int id)
        {
            var item = context.GetSingle(id);

            item.IsDeleted = true;
            context.Save();
            return(Ok());
        }
示例#2
0
 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));
 }