J’ai utilisé une struct
public struct stuff { public int ID; public int quan; }
dans la List stuff = new List();
Comment je peux vérifier la liste ont déjà un truc “où ID = 1”?
Vous pouvez utiliser LINQ très facilement
bool res = stuff.Any(c => c.ID == 1);
bool isContains = stuff.Any(x => x.ID == 1);
if(stuf.Select(x => x.id).Contains(1)) { //Do Stuff }