/// <summary>
        /// 
        /// </summary>
        /// <param name="snapshot"></param>
        /// <param name="module"></param>
        /// <returns></returns>
        private static List<ViolationSummaryDTO> GetEvolutionSummary(Snapshot snapshot, Module module)
        {
            if (snapshot == null || snapshot.BusinessCriteriaResults == null || module==null) return null;

            return snapshot.BusinessCriteriaResults.Where(_ => _.ModulesResult.Any(m => m.Module !=null && m.Module.Equals(module) && m.DetailResult != null && m.DetailResult.EvolutionSummary != null))
                                                   .Select(_ =>  new ViolationSummaryDTO
                                                                 {
                                                                       BusinessCriteria = (Constants.BusinessCriteria)_.Reference.Key,
                                                                       Total = _.ModulesResult.FirstOrDefault(m => m.Module.Equals(module)).DetailResult.EvolutionSummary.TotalCriticalViolations,
                                                                       Added = _.ModulesResult.FirstOrDefault(m => m.Module.Equals(module)).DetailResult.EvolutionSummary.AddedCriticalViolations,
                                                                       Removed = _.ModulesResult.FirstOrDefault(m => m.Module.Equals(module)).DetailResult.EvolutionSummary.RemovedCriticalViolations
                                                                 })
                                                   .ToList();
        }
예제 #2
0
 private static ResultDetail GetModuleResult(ApplicationResult ar, Module module)
 {
     ResultDetail detailResult = null;
     if (module != null) {
         var modResult = ar.ModulesResult.FirstOrDefault(mr => mr != null && mr.Module.Id == module.Id);
         if (modResult != null)
             detailResult = modResult.DetailResult;
     }
     return detailResult;
 }