List set queried by LINQ

Source: Internet
Author: User

I always heard my colleagues talk about LINQ and know that I learned it when I went to school. But I have never used it since I graduated. I always think it is a good skill, but when I really learned how to use it, I found that so easy. Let's talk a little bit about code.

VaR list1 = (from F in listfund where F. userid = ID & (f. changetype = 1 | f. changetype = 40) & (f. reasontype = 40 | f. reasontype = 1) Select F. amount ). sum ();

This is a piece of code for querying the list set by using LINQ. In fact, it is similar to SQL statement usage, except that in is followed by a list set. I understand it as traversal. Where is followed by the query condition select followed by the field to be queried, the only difference is the select position.

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.