public string DeletePhoto(string publicId) { var deleteParams = new DeletionParams(publicId); var result = _cloudinary.Destroy(deleteParams); return(result.Result == "ok" ? result.Result : null); }
public DeletionResult ImageDelete(string publicId) { var deletionParams = new DeletionParams(publicId); var deletionResult = _cloudinary.Destroy(deletionParams); return(deletionResult); }
public DelResResult DeletePicture(Type entityType, string pictureId) { if (entityType == null || string.IsNullOrEmpty(pictureId) || string.IsNullOrWhiteSpace(pictureId)) { return(null); } DeletionParams deletionParams = new DeletionParams($"{entityType.Name}Picture/{pictureId}"); var delResult = cloudinary.Destroy(deletionParams); return(null); }
public IActionResult DeletePhoto(int movieId, int photoId) { var movie = _context.Movies.Include(x => x.Photos).FirstOrDefault(x => x.Id == movieId); if (movie == null) { return(BadRequest()); } var photo = movie.Photos.FirstOrDefault(x => x.Id == photoId); if (photo != null) { movie.Photos.Remove(photo); } _context.Movies.Update(movie); var deleteParams = new DeletionParams(photo.PublicId); _cloudinary.Destroy(deleteParams); _context.SaveChanges(); return(NoContent()); }
/// <summary> /// Delete a blob. /// </summary> /// <param name="blobName">Virtual blob name.</param> public virtual void Delete(string blobName) { var deletion = new DeletionParams(GetPublicId(blobName)); var result = _client.Destroy(deletion); }