Veuillez me suggérer le changement aussi .. Impossible de convertir implicitement le type 'System.Collections.Generic.List' en System.Collections.Generic.IEnumerable '. Une conversion explicite existe (vous manque un casting?)Erreur de conversion implicite
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace MyNamespace
{
class Program
{
static void Main(string[] args)
{
List<int> eventIDs = new List<int>() { 53,90,344,2223,2225,4497,5512};
MatchNumbers(eventIDs,2200,2300);
}
public static void MatchNumbers(IEnumerable<uint> eventsSet, int lowerBound, int upperBound)
{
if (upperBound < lowerBound)
throw new Exception("Lower bound cant be bigger");
List<int> itemSet = (List<int>)eventsSet;
for (int i = lowerBound; i <= upperBound; i++)
{
int result = itemSet.BinarySearch(i);
if (result >= 0)
Console.WriteLine("Found{0}", i);
}
}
}
}
Le compilateur a déjà trouvé l'erreur pour vous. – BoltClock