I just wonder if it's possible to make it better (and I guess there are many, many better ways to do it). So the question is how to return true if in my list are 4 types of components. My list may contain 1000 of them , but I just need to return true if there are 4 objects of different types (CPU, GPU, RAM, PowerSupply). These objects are children of abstract class Component and contain property of enum type.
public bool IsWorking()
{
bool hasCPU = AllComponents.Any(component => component.CompType == ComponentsType.CPU);
bool hasGPU = AllComponents.Any(component => component.CompType == ComponentsType.GPU);
bool hasPowerSupply = AllComponents.Any(component => component.CompType == ComponentsType.PowerSupply);
bool hasRAM = AllComponents.Any(component => component.CompType == ComponentsType.RAM);
bool? hasAllNeededComp // JUST WONDERING HOW TO MAKE IT BETTER
}