Esempio n. 1
0
        public ActionResult Edit(Content Contentpara, HttpPostedFileBase image = null)
        {
            if (ModelState.IsValid)
            {
                if (image != null)
                {
                    Contentpara.ImageType = image.ContentType;
                    Contentpara.ImageData = new byte[image.ContentLength];
                    image.InputStream.Read(Contentpara.ImageData, 0, image.ContentLength);
                    myrepo.AddContent(Contentpara);
                }
                else
                {
                    myrepo.AddContent(Contentpara);
                }


                return(RedirectToAction("Index"));
            }
            else
            {
                return(View(Contentpara));
            }
        }