public async Task <IStandardInstance> ToStandardObject(Topic topic, List <Comment> comments)
        {
            var author = topic.AuthorId == null ? null : await _dbService.GetClientUserFrom(_configSettings.UserColumnName, topic.AuthorId);

            var assignee = topic.AssignedToId == null ? null : await _dbService.GetClientUserFrom(_configSettings.UserColumnName, topic.AssignedToId);

            var instance = new StandardTopic()
            {
                Identifiers = GetIdentifiers(topic.Id, topic.ProjectId, comments),
                Author      = author,
                Assignee    = assignee,
                Created     = topic.CreationDate.Value,
                Summary     = topic.Title,
                Type        = topic.TopicType,
                Status      = topic.Status,
                Priority    = topic.Priority,
                Labels      = topic.Labels
            };

            return(instance);
        }
예제 #2
0
 public async Task <IStandardComment> ToStandardComment(Comment comment, List <Comment> allComments, List <ViewPoint> viewpoints)
 {
     return(new StandardComment()
     {
         Author = comment.AuthorId == null ? null : await _dbService.GetClientUserFrom(_configSettings.UserColumnName, comment.AuthorId),
         Content = comment.Content,
         Created = comment.Date,
         Status = comment.Status,
         Priority = comment.Priority,
         Identifiers = EasyAccessInstanceMapper.GetIdentifiers(comment.TopicGuid, comment.ProjectId, allComments),
         ViewpointIds = viewpoints?.Select(vp => vp.Id).ToList()
     });
 }
 private async Task <ClientUser> GetUserMap(string user)
 {
     return(await _dbService.GetClientUserFrom(userColumnName, user));
 }