常用方法
常用方法
常用方法
常用方法
public IActionResult GetBlogPost([FromRoute] string slug) { try { var blog = _repositoryBlogPost.GetBySlug(slug); if (blog == null) { return(NotFound("There is no blog with that slug")); } return(Ok(blog)); } catch (Exception ex) { _logger.LogError(ex.Message, ex); return(StatusCode(500)); } }