public void InsertSlide(SlideModel slide)
 {
     context.Slides.Add(slide);
 }
 public void UpdateSlide(SlideModel slide)
 {
     context.Entry(slide).State = EntityState.Modified;
 }
 public ActionResult Save(string[] images, int id)
 {
     for (int i = 1; i < images.Length; ++i)
     {
         var slide = slideRepository.GetSlide(id, i);
         if (slide == null)
         {
             SlideModel newSlide = new SlideModel();
             newSlide.Data = images[i];
             newSlide.PresentationId = id;
             newSlide.SlideNumber = i;
             slideRepository.InsertSlide(newSlide);
             slideRepository.Save();
         }
         else
         {
             slide.Data = images[i];
             slideRepository.UpdateSlide(slide);
             slideRepository.Save();
         }
     }
     return null;
 }