I created a Command-class which has two important members.
public class Command
{
public string Name { get; set; }
public CommandExecutedCallback Callback { get; set; }
public delegate void CommandExecutedCallback(Command command);
}
I save multiple objects of this class in a List<Command>.
Another class CommandProcessor has a member function GetCallbacks(string name).
I want to use a lambda expression to get an array of CommandExecutedCallback-delegates with the condition that the name matches.
I can get all Callbacks with: return commandList.Select(t => t.Callback).ToArray().
How can i insert the condition to get only commands with the specified name?
Thank you in advance.
Selectis for a projection. UseWherefor filtering.