public static void AddPresentation(PresentationExModel model)
 {
     using (var context = DatabaseContext.Create())
     {
         context.AddPresentation(model);
     }
 }
        public void AddPresentation(PresentationExModel model)
        {
            ConnectionPhotos(model);

            AspNetPresentations.Add(new PresentationModel() { 
                PresentationId = model.PresentationId,
                UserId = model.UserId,
                PathBeginPhoto = model.PathBeginPhoto
            });
            SaveChanges();
        }
 private void ConnectionPhotos(PresentationExModel model)
 {
     foreach (var a in model.Photos)
     {
         var photo = AspNetPhotos.Where(p => p.PhotoId == a.PhotoId).FirstOrDefault();
         if (photo != null)
         {
             photo.PresentationId = a.PresentationId;
             photo.PositionNumber = a.PositionNumber;
         }
     }
 }