Пример #1
0
        public async Task <IActionResult> PutComment(int id, PublicApi.v1.DTO.Comment comment)
        {
            if (id != comment.Id)
            {
                return(BadRequest());
            }

            _bll.Comments.Update(CommentMapper.MapFromExternal(comment));
            await _bll.SaveChangesAsync();

            return(NoContent());
        }
Пример #2
0
        public async Task <IActionResult> PutComment(int id, PublicApi.v1.DTO.Comment comment)
        {
            if (!ModelState.IsValid || id != comment.Id || comment.ShopId != User.GetShopId())
            {
                return(BadRequest());
            }

            _bll.Comments.Update(CommentMapper.MapFromExternal(comment));
            await _bll.SaveChangesAsync();

            return(NoContent());
        }