I have a list of objects, of class Author, and I want to search this list of authors, based on one of the Author's properties, name, and when I receive a match I would like to return the instance of Author to be used to create an instance of another class, that requires Author as part of its constructor.
A better way to explain it would be:
author getAuthor(String arg_name)
{
foreach (author auth in authorList)
{
if (auth.name == arg_name)
{
return auth;
}
}
}
Although I realize this specific code does work, is there a better way to perform this action?