So I have a list of objects from a class. In this list I want to get the object where Table.name == "value"
Class Table{
public string name;
private string primarykey;
private string[] columnNames;
//some methods and functions
}
My question is there an efficient way to get the specified object from this list with linq for example or do I just loop through this with a basic searching algoritm.
With a basic search algoritm I mean:
foreach(Table t in tables)
{
if(t.name == "value")
return t;
}
So is there a more efficient way to do this with linq for example?