Example #1
0
        public void DeleteOne(int id)
        {
            var photoToTags = _providerPhotoToTag.GetAll().Where(x => x.TagId == id).ToList();

            if (photoToTags.Count() > 0)
            {
                _providerPhotoToTag.DeleteMany(photoToTags.Select(x => x.Id).ToArray());
            }

            _providerTag.DeleteOne(id);
            _providerTag.Commit();
        }
Example #2
0
        public void DeleteOne(int id)
        {
            var photos = _photoService.GetAll().Where(x => x.AlbumId == id);

            if (photos.Count() > 0)
            {
                _photoService.DeleteMany(photos.Select(x => x.Id).ToArray());
            }

            _providerAlbum.DeleteOne(id);
            _providerAlbum.Commit();
        }
Example #3
0
        public void DeleteOne(int id)
        {
            var photo       = GetOne(id);
            var photoToTags = _providerPhotoToTag.GetAll().Where(x => x.PhotoId == id).ToList();
            var watermark   = _providerWatermark.GetAll().FirstOrDefault(x => x.PhotoId == id);

            if (photoToTags.Count() > 0)
            {
                _providerPhotoToTag.DeleteMany(photoToTags.Select(x => x.Id).ToArray());
            }

            if (watermark != null)
            {
                _providerWatermark.DeleteOne(watermark.Id);
            }

            System.IO.File.Delete(HttpContext.Current?.Server?.MapPath(photo?.PhotoPath));
            System.IO.File.Delete(HttpContext.Current?.Server?.MapPath(photo?.ThumbnailPath));

            _providerPhoto.DeleteOne(id);
            _providerPhoto.Commit();
        }
Example #4
0
 public void DeleteOne(int id)
 {
     _providerWatermark.DeleteOne(id);
     _providerWatermark.Commit();
 }
Example #5
0
 public void DeleteOne(int id)
 {
     _providerAttr.DeleteOne(id);
     _providerAttr.Commit();
 }