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(); }
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(); }
public bool Save() { return(_ijpContext.SaveChanges() >= 0); }