I have a method which looks the following way:
bool GetIdByName(string name, out ID id)
I would like to use it inside a lambda expression, to get several 'ids' by a number of 'names':
var ids = names.Select(name => idService.GetIdByName(name, out id));
In this case I will find all the bool values inside my 'ids' variable, which is not what I want. Is it also possible to get the out parameter 'id' of each call into it?
outparameter forid? Why not simply return theiditself? Are there cases when no id exists?