I have rephased my message with explicit question.
I have two different list.
List<Car> car = GetCars();
List<int> carListNumber = new List<int> { 1, 2, 3};
public Car
{
public int number
public string color
public string brand
}
My request is to achieve a new Car list that shall contain number 1,2,3 based on LinQ coding?
In order to get this specific car you have to recieve right car number from carListNumber.
So you want to take a car from the list, say BMW, and find out it’s number?
I really struggle to understand quite what you want to do. You can address a List with an index. Will that help?
EDIT out the below:
Finally understood what you want to do. Do you want the order of cars to be driving, or the order of numbers? If you have BMW2, Audi1, do you want the number order to be 2, 1, or the car order to be Audi, BMW. Then I will help with the code 🙂
If you need any more help, can you please re-explain your question, and also, could you please do us a big favour, and mark/up-vote suitable answers in your previous questions.
Thanks so much!