// PUBLIC METHODS:
        public void Execute(Post_DTO post)
        {
            var _postedBy = _userRepository.Get(post.CreatedBy);

            if (_postedBy == null)
            {
                _userRepository.Add(new User_DTO {
                    Name = post.CreatedBy
                });
            }

            _postRepository.Add(post);
        }
Beispiel #2
0
 // CONSTRUCTOR:
 public InputsController(
     IPostUseCase postUseCase,
     ISubscribeUseCase subscribeUseCase,
     IReadUseCase readUseCase,
     IGetWallUseCase getWallUseCase,
     Post_DTO post,
     Subscription_DTO subscription
     )
 {
     _postUseCase      = postUseCase;
     _subscribeUseCase = subscribeUseCase;
     _readUseCase      = readUseCase;
     _getWallUseCase   = getWallUseCase;
     _post             = post;
     _subscription     = subscription;
 }
Beispiel #3
0
 // PUBLIC METHODS:
 public void Add(Post_DTO post)
 {
     _context.Posts.Add(_mapper.Map <Post>(post));
 }