public PostViewModel Get(int postId)
{
Condition.Requires(postId, "postId").IsGreaterOrEqual(0);
Post post = null;
using (IUnitOfWork unitOfWork = _unitOfWorkFactory.Create())
{
unitOfWork.Execute(() =>
{
IRepository<Post> repository = unitOfWork.GetRepository<Post>();
post= repository
.AllIncluding(x => x.Categories, x => x.Author)
.Single(x => x.PostID == postId);
});
}
return _postMapper.Map(post);
}