C # in Depth (nineth lambda expression and expression tree)

Source: Internet
Author: User

The basic function of LINQ is to create operational pipelines and any state that these operations require. These operations represent a variety of logic about the data: How to filter, how to sort, and how to connect different data sources together.

9.1 Lambda expression as a delegate

  • In many ways, lambda expressions can be seen as an evolution of c#2.0 anonymous methods. Almost everything an anonymous method can do can be done with a lambda expression.
  • the type of an expression is not itself a delegate type , but it can be implicitly or explicitly converted to a delegate instance in several ways.

9.1.1 Preparation: func<...> delegate type Introduction

If we need to get a string parameter and return an int, we will use Func<string, int>

C # in Depth (nineth lambda expression and expression tree)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.