Blog.Logic.Core.PostsLogic.UpdatePost C# (CSharp) Method

UpdatePost() public method

public UpdatePost ( Post post ) : Post
post Blog.Common.Contracts.Post
return Blog.Common.Contracts.Post
        public Post UpdatePost(Post post)
        {
            try
            {
                if (!ValidatePostContents(post.PostContents))
                    throw new Exception("Cannot upload more than one video.");

                post = PostCleanUp(post);
                
                var tPost = _postRepository.Edit(PostMapper.ToEntity(post));
                return EntityToDtoPostCleanUp(tPost, tPost.PostId);
            }
            catch (Exception ex)
            {
                throw new BlogException(ex.Message, ex.InnerException);
            }
        }