public Post GetPost(int postId)
{
try
{
var db = _postRepository.Find(a => a.PostId == postId, null, "Tags,User,Communities").FirstOrDefault();
if (db == null)
{
return new Post().GenerateError<Post>((int)Constants.Error.RecordNotFound,
string.Format("Cannot find post with Id {0}", postId));
}
return EntityToDtoPostCleanUp(db, postId);
}
catch (Exception ex)
{
throw new BlogException(ex.Message, ex.InnerException);
}
}