Exemplo n.º 1
0
        public Dictionary <DateTime, Dictionary <string, T> > GetAllDocumentsByProjectNameAndDocumentType <T>() where T : IOutputJson
        {
            logger.LogToConsole($"Requesting for all ('{projectName}') documents of '({DocumentTypeHelper.GetDocumentType<T>()}') type.");

            var documents = dataDocumentRepository.GetAllDocumentsByProjectAndDocumentType <T>(projectName, DocumentTypeHelper.GetDocumentType <T>());
            var data      = ConvertDataFromCosmosDb(documents);

            logger.LogToConsole($"Received {data.Count} ('{projectName}') documents of '({DocumentTypeHelper.GetDocumentType<T>()}') type.");

            return(data);
        }
        public void ProcessCache(IChangesetProcessor changesetProcessor)
        {
            var workItemDocuments = dataDocumentRepository.GetAllDocumentsByProjectAndDocumentType <WorkItem>(projectName, DocumentType.BugDatabase);

            logger.LogToConsole($"Processing {workItemDocuments.Count} work items of {projectName} project");

            foreach (var workDocument in workItemDocuments)
            {
                foreach (var workItemList in workDocument.Data)
                {
                    if (workItemList.ChangesetId == null)
                    {
                        continue;
                    }
                    if (!changesetProcessor.WorkItemCache.ContainsKey(workItemList.ChangesetId))
                    {
                        changesetProcessor.WorkItemCache.Add(workItemList.ChangesetId, new List <WorkItem>());
                    }

                    changesetProcessor.WorkItemCache[workItemList.ChangesetId].Add(workItemList);
                }
            }
        }