Exemplo n.º 1
0
        public async Task <string> AddTopicAsync(ResponseData.Topic topic)
        {
            await _topicRepository.AddTopicAsync(new DataEntity.Topic {
                Description = topic.Description,
                Notes       = topic.Notes
            });

            return(""); // TODO - return new topic id
        }
Exemplo n.º 2
0
        public async Task <ResponseData.Topic> UpdateTopic(string topicId, ResponseData.Topic topic)
        {
            var resultUpdatedTopicEntity = await _topicRepository.UpdateTopicAsync(topicId,
                                                                                   new DataEntity.Topic {
                Description = topic.Description,
                Notes       = topic.Notes
            });

            if (resultUpdatedTopicEntity != null)
            {
                return(new ResponseData.Topic {
                    Id = resultUpdatedTopicEntity.Id,
                    Description = resultUpdatedTopicEntity.Description,
                    Notes = resultUpdatedTopicEntity.Notes
                });
            }
            return(null);
        }