public ItemsWithConflictingHighestScoreException(ItemWithScore[] itemsWithConflictingScore, ItemWithScore[] allItems, int highestScore)
     : base(string.Format(
     "items with conflicting highest score of {0} exists, cannot determine default", highestScore))
 {
     ItemsWithConflictingScore = itemsWithConflictingScore;
     AllItems = allItems;
     HighestScore = highestScore;
 }
示例#2
0
 private bool TrySelectDefault(ItemWithScore[] itemsWithCalculatedScore, out ItemEvaluation? defaultItem)
 {
     var itemsWithNoReferences = itemsWithCalculatedScore.Where(x => !x.Item.ConditionsEvaluation.Any());
     if (itemsWithNoReferences.Count() != 1)
     {
         defaultItem = null;
         return false;
     }
     defaultItem = itemsWithNoReferences.Single().Item;
     return true;
 }