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

AddPost() public method

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

                post = PostCleanUp(post);

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