Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What is the syntax () => ?
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
01634746
Message ID:
01634780
Vues:
57
It's what's called Expression Syntax, which can be used as 'anonymous functions'. It's basically a function (or single line expression) that is executed without requiring an explicit function name. The compiler turns that code into a delegate object with a method that is executed. IOW, it's compiler surgar for making life easier. It's just a more terse way to express to implement small snippets of code. For larger blocks of code it's still recommended that you rather use a named callback function instead.

It's primarily used with LINQ queries to handle inline query expressions, or for Async task callback functions.

The brackets describe the inbound parameter list and the type of the return value determines the type of the method.


Thanks for the nice concise explanation.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform