LINQ basic query of relational data

Source: Internet
Author: User

As shown in the relational data, the LINQ statement is:


varquery= fromAinchdata. Awherea.admin== the incoming user name &&a.pwd==Incoming Password (you can pass in a model entity)Join Binchdata. B on a.bid equals b.id into AB fromR1inchAB. DefaultIfEmpty () Join Cinchdata. C on r1.cid equals c.id into BC fromR2inchBC. DefaultIfEmpty () Join Dinchdata. D on R2.did equals d.id into CD fromR3inchCD. DefaultIfEmpty ()

Select New {//here is the ID of table A;Id =a.ID,//here is the name of table B;Name =R1. Name, Pro=R2. Pro, Ipadd=R3. Ipadd};//To the form of an array; varList =query.tolist ();//List[0]. Name is the name of Table B for the first data that represents the result of the entire LINQ query, and so on;

Note : R1 can. All data out of Table B ... And so on

R2==table C;

R3==table D;

LINQ basic query of relational data

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.