public PostContent Get(int postContentId)
{
try
{
var db = _postContentRepository.Find(a => a.PostContentId == postContentId, true).FirstOrDefault();
if (db != null)
{
db.Media.MediaPath = null;
db.Media.ThumbnailPath = null;
return PostContentMapper.ToDto(db);
}
return new PostContent().GenerateError<PostContent>(
(int)Constants.Error.RecordNotFound,
string.Format("Cannot find post content with Id {0}", postContentId));
}
catch (Exception ex)
{
throw new BlogException(ex.Message, ex.InnerException);
}
}