Esempio n. 1
0
        public IHttpActionResult UploadPhotoForDeck(string linking)
        {
            try
            {
                var photoLink   = UploadPhoto(SaveFile(), linking);
                var updatedDeck = moderation.FindDeckByLinking(linking);
                updatedDeck.Photo = photoLink;
                moderation.UpdateDeck(updatedDeck);

                return(this.Ok(photoLink));
            }
            catch (ArgumentNullException ex)
            {
                var message = $"Photo not found. {ex.Message}";
                return(this.BadRequest(message));
            }
        }