Example #1
0
        public IHttpActionResult Delete(int id)
        {
            var result = _movieStore.Delete(id);

            if (result != null)
            {
                return(Ok(result));
            }
            return(NotFound());
        }
Example #2
0
        public async Task <ActionResult> Delete(long id)
        {
            // Delete book cover image from Cloud Storage if ImageUrl exists
            string imageUrlToDelete = _store.Read((long)id).ImageUrl;

            if (imageUrlToDelete != null)
            {
                await _imageUploader.DeleteUploadedImage(id);
            }
            _store.Delete(id);
            return(RedirectToAction("Index"));
        }