Exemplo n.º 1
0
        public PostDTO AddPost(IFormFile file, Post post)
        {
            CompletePostDTO completePost = new CompletePostDTO()
            {
                FileInPost = file,
                Post       = post
            };

            IPostHandler textPost  = new PostText(postRepository, unitOfWork);
            IPostHandler imagePost = new PostImage(postRepository, unitOfWork, cloudinary);
            IPostHandler videoPost = new PostVideo(postRepository, unitOfWork, cloudinary);

            textPost.SetNextPostType(imagePost);
            imagePost.SetNextPostType(videoPost);

            textPost.EvaluatePost(completePost);

            return(mapper.Map <PostDTO>(post));
        }