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(); }
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(); }
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(); }
public void DeleteOne(int id) { _providerWatermark.DeleteOne(id); _providerWatermark.Commit(); }
public void DeleteOne(int id) { _providerAttr.DeleteOne(id); _providerAttr.Commit(); }