예제 #1
0
        public async Task <IActionResult> CreatePhoto([FromBody] CreatePhotoModel input)
        {
            logger.LogInformation($"{nameof(CreatePhoto)}({nameof(input.Filename)} = '{input.Filename}')");

            try
            {
                var photo = await photosService.CreatePhoto(GetCurrentUserId(), GetCurrentUserName(), input.Filename, input.Text);

                return(Json(photoModelConverter.ToPublic(photo)));
            }
            catch (Exception ex)
            {
                logger.LogError(ex, $"Error in {nameof(CreatePhoto)}({nameof(input.Filename)} = '{input.Filename}'):\n{ex.ToString()}");
                throw;
            }
        }