コード例 #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
ファイル: MyGalleries.cs プロジェクト: skepee/Web-Images-IDP
        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);
 }