예제 #1
0
        public async Task <IActionResult> GetBlogById(int blogId)
        {
            try
            {
                var result = await _blogServices.GetBlogById(blogId);

                if (result == null)
                {
                    return(new BadRequestObjectResult(new { Message = "Không tìm thấy tin tức " }));
                }
                return(Ok(result));
            }
            catch (Exception ex)
            {
                return(new BadRequestObjectResult(new { Message = ex.Message.ToString() }));
            }
        }