Blog.Web.Api.Controllers.PostsController.GetUserPosts C# (CSharp) Method

GetUserPosts() private method

private GetUserPosts ( int userId ) : IHttpActionResult
userId int
return IHttpActionResult
        public IHttpActionResult GetUserPosts(int userId)
        {
            try
            {
                var posts = _postsSvc.GetPostsByUser(userId) ?? new List<Post>();
                return Ok(posts);
            }
            catch (Exception ex)
            {
                _errorSignaler.SignalFromCurrentContext(ex);
                return BadRequest();
            }
        }