예제 #1
0
        public override async Task <AddTopicResponse> Add(AddTopicRequest request, ServerCallContext context)
        {
            var id = await _topicService.AddTopicAsync(new Topic
                                                       { Name = request.Name, Description = request.Description });

            _logger.Info(id > 0 ? "Topic added successfully" : "Topic was not added");

            return(await Task.FromResult(new AddTopicResponse { Id = id }));
        }