Ejemplo n.º 1
0
        public override async Task <BooleanResponse> AddComment(CommentItem request, ServerCallContext context)
        {
            Comment comment = new Comment()
            {
                CommentId  = request.CommentId,
                Text       = request.Text,
                PostPostId = request.PostPostId,
                Post       = _repository.GetPostById(request.PostPostId)
            };

            BooleanResponse response = new BooleanResponse
            {
                Response = _repository.AddComment(comment)
            };

            return(response);
        }
Ejemplo n.º 2
0
        public override async Task <BooleanResponse> AddPost(PostItem request, ServerCallContext context)
        {
            Post post = new Post()
            {
                PostId      = request.PostId,
                Description = request.Description,
                Domain      = request.Domain,
                Date        = request.Date.ToDateTime()
            };

            BooleanResponse response = new BooleanResponse
            {
                Response = _repository.AddPost(post)
            };

            return(response);
        }