コード例 #1
0
        public async Task <IActionResult> Get(string userName, string title)
        {
            try
            {
                var result = await _commentsRepository.GetAllCommentsAsync(userName, title);

                if (result != null)
                {
                    return(Ok(result));
                }
            }
            catch (Exception e)
            {
                _logger.LogError($"Error while getting comments\n {e.Message}");
            }

            return(BadRequest());
        }