//Удалить комментарий
        public void Delete(CommentBindingModel model)
        {
            var element = _commentStorage.GetElement(new CommentBindingModel {
                Id = model.Id
            });

            if (element == null)
            {
                throw new Exception("Элемент не найден");
            }
            _commentStorage.Delete(model);
        }
コード例 #2
0
ファイル: NewsController.cs プロジェクト: Ptize/NewsPortal
 public async Task DeleteComment([FromRoute] Guid newsId, [FromRoute] Guid userId)
 {
     await _commentStorage.Delete(newsId, userId);
 }