Exemplo n.º 1
0
        public async Task <ActionResult> DeleteImage(CloudImageViewModel image)
        {
            try
            {
                if (image == null)
                {
                    logger.LogError($"Image object sent from client is null");
                    return(BadRequest("Image object is null"));
                }

                await storageService.DeleteImage(image.Url).ConfigureAwait(false);

                return(Ok());
            }
            catch (Exception ex)
            {
                logger.LogError($"Something went wrong inside DeleteImage action: {ex.Message}");
                return(StatusCode(500, "Internal server error"));
            }
        }