Example #1
0
        public override Task <PostModel> GetPostInfo(PostLookUpModel request, ServerCallContext context)
        {
            Post post = API.GetPostById(request.Id);

            return(Task.FromResult(new PostModel
            {
                Id = post.PostId,
                Description = post.Description,
                Domain = post.Domain,
                Date = Timestamp.FromDateTime(post.Date)
            }));
        }
Example #2
0
        public override Task <PostActionReply> DeletePost(PostLookUpModel request, ServerCallContext context)
        {
            var success = API.DeletePost(request.Id);

            if (success != 0)
            {
                return(Task.FromResult(new PostActionReply
                {
                    Message = "Success"
                }));
            }
            else
            {
                return(Task.FromResult(new PostActionReply
                {
                    Message = "Fail"
                }));
            }
        }