How to define Linq delegation
This article mainly explains the "Linq delegation how to define", the article explains the content is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in-depth, together to study and learn "Linq delegation how to define" it!
Definition of delegate:
Delegate string ProcessString (string input)
Delegate can be understood as a function pointer, which defines a prototype of a function.
Linq delegate instantiation and use:
ProcessString p = new ProcessString (LowerIt); / / instantiation of the delegate is to point the delegate variable to an actual method foreach (string name in foxRiver8) {Console.WriteLine (p (name)) that conforms to the delegate prototype; / / p at this time is actually the LowerIt () method}
Linq delegate instantiation points to an actual method that conforms to the delegate prototype:
Private string LowerIt (string input) {return input.ToLower ();} Thank you for your reading, this is the content of "how to define Linq delegation". After the study of this article, I believe you have a deeper understanding of how to define Linq delegation, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!