I searched all over for a way to pass ToUpper or ToLower as a parameter. I looked at actions, I looked at delegates, I looked at extension methods, and I looked at Microsoft documentation. The closest answer I got was: Passing an extension method to a method expecting a delegate. How does this work?, but that didn't really explain how to do it. I am writing this question in case someone else runs across a similar problem. For example, you can't pass string.ToLower() as a parameter.
The issue is figuring out:
- How to call string.toLower() as a delegate?
Example of what I want to be able to do:
orderItems.GetContatenatedModdedNames(string.ToLower());
orderItems.GetConcatenatedModdedNames(string.ToUpper());
The example idea is to be able to pass in ToLower() or ToUpper() as a parameter.