/// <summary>
        /// The GetPostsByPaging
        /// </summary>
        /// <param name="_postBusinessService">The _postBusinessService<see cref="IPostBusinessService"/></param>
        /// <param name="page">The page<see cref="int"/></param>
        /// <param name="pageSize">The pageSize<see cref="int"/></param>
        /// <returns>The <see cref="PostViewModel"/></returns>
        public static PostViewModel GetPostsByPaging(IPostBusinessService _postBusinessService, int page, int pageSize)
        {
            var transaction = new TransactionalInformation();
            var posts       = _postBusinessService
                              .GetPostsByPaging(page, pageSize, out transaction);
            var postViewModel = new PostViewModel();

            if (transaction.ReturnStatus == false)
            {
                postViewModel.ReturnStatus     = false;
                postViewModel.ReturnMessage    = transaction.ReturnMessage;
                postViewModel.ValidationErrors = transaction.ValidationErrors;

                //var responseError = Request.CreateResponse(HttpStatusCode.BadRequest, productCategoryViewModel);
                //return responseError;
            }
            else
            {
                postViewModel.ReturnStatus  = true;
                postViewModel.ReturnMessage = transaction.ReturnMessage;
                postViewModel.PostDTOs      = posts;
                postViewModel.Pager         = transaction.Pager;
            }

            return(postViewModel);
        }
        /// <summary>
        /// The GetPostDetail
        /// </summary>
        /// <param name="_postBusinessService">The _postBusinessService<see cref="IPostBusinessService"/></param>
        /// <param name="id">The id<see cref="int"/></param>
        /// <returns>The <see cref="PostViewModel"/></returns>
        public static PostViewModel GetPostDetail(IPostBusinessService _postBusinessService, int id)
        {
            var transaction = new TransactionalInformation();
            var posts       = _postBusinessService
                              .GetPost(id, out transaction);
            var postViewModel = new PostViewModel();

            if (transaction.ReturnStatus == false)
            {
                postViewModel.ReturnStatus     = false;
                postViewModel.ReturnMessage    = transaction.ReturnMessage;
                postViewModel.ValidationErrors = transaction.ValidationErrors;

                //var responseError = Request.CreateResponse(HttpStatusCode.BadRequest, productCategoryViewModel);
                //return responseError;
            }
            else
            {
                postViewModel.ReturnStatus  = true;
                postViewModel.ReturnMessage = transaction.ReturnMessage;

                postViewModel.Alias           = posts.Alias;
                postViewModel.CategoryName    = posts.CategoryName;
                postViewModel.Content         = posts.Content;
                postViewModel.Description     = posts.Description;
                postViewModel.CreatedBy       = posts.CreatedBy;
                postViewModel.CreatedDate     = posts.CreatedDate;
                postViewModel.UpdatedBy       = posts.UpdatedBy;
                postViewModel.UpdatedDate     = posts.UpdatedDate;
                postViewModel.MetaDescription = posts.MetaDescription;
                postViewModel.MetaKeyword     = posts.MetaKeyword;
                postViewModel.Image           = posts.Image;

                postViewModel.Pager = transaction.Pager;
            }

            return(postViewModel);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="PostController"/> class.
 /// </summary>
 /// <param name="postBusinessService">The postBusinessService<see cref="IPostBusinessService"/></param>
 /// <param name="postCategoryBusinessService">The postCategoryBusinessService<see cref="IPostCategoryBusinessService"/></param>
 public PostController(IPostBusinessService postBusinessService, IPostCategoryBusinessService postCategoryBusinessService)
 {
     _postBusinessService         = postBusinessService;
     _postCategoryBusinessService = postCategoryBusinessService;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="PostServiceController"/> class.
 /// </summary>
 /// <param name="postBusinessService">The postBusinessService<see cref="IPostBusinessService"/></param>
 public PostServiceController(IPostBusinessService postBusinessService)
 {
     _postBusinessService = postBusinessService;
 }