C# - how to pass 'out' parameter into lambda expression
I have a method with the following signature: private PropertyInfo getPropertyForDBField(string dbField, out string prettyName) In it, I find the associated value prettyName based on the given dbField . I then want to find all properties, if any, that have the name prettyName , so I'm trying to do the following: IEnumerable<PropertyInfo> matchingProperties = getLocalProperties().Where(prop => prop.Name.Equals(prettyName) ); However, this gives the following error: Cannot use ref or out parameter 'prettyName' inside an anonymous method, lambda expression, or query expression By the point in the