Пример #1
0
        public void AddImageFromFile(string file, string resized, string thumb, string userid)
        {
            var myfile = new FileModel();

            myfile.Info(file, resized, thumb, userid);

            ijpContext.File.Add(myfile);
            ijpContext.SaveChanges();
        }
Пример #2
0
        public void RemoveGallery(int galleryId)
        {
            using TransactionScope scope = new TransactionScope();

            var galleryfile = ijpContext.GalleryFile.Where(x => x.GalleryId == galleryId);

            ijpContext.GalleryFile.RemoveRange(galleryfile);
            ijpContext.SaveChanges();

            var gallery = ijpContext.Gallery.FirstOrDefault(x => x.GalleryId == galleryId);

            ijpContext.Gallery.Remove(gallery);
            ijpContext.SaveChanges();

            scope.Complete();
        }
Пример #3
0
 public bool Save()
 {
     return(_ijpContext.SaveChanges() >= 0);
 }