Exemplo n.º 1
0
        public async Task <IActionResult> UpdateTag([FromBody] Dto.Tag tag)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(new ProblemModel(ModelState)));
            }

            try
            {
                var tagEntity = await _photoSevice.SaveTag(tag.ToModel());

                return(Ok(new Dto.Tag(tagEntity)));
            }
            catch (InvalidOperationException ex)
            {
                return(BadRequest(new { ex.Message }));
            }
        }