Simple to use Linq statement

 

Development tools and key technologies: VS, MVC

Author: Chen Xingyu

Write Time: April 1

This code can be seen, lingq notation statement is

By from to the field hands, tbUser custom attributes in followed by a data source, and then we can where to operate the data conditional statement

Finally, select to query the data keyword

In addition to directly query the entire table, we can also write anonymously

By anonymous form we can query the fields that we want to query, you do not always have to search the entire table , we can selectively query field we want to query

We can finish the query data

SINGLE () , query data singled out, when there is no data or more data will trigger an exception

Tilist () , and query multiple data into List format

Count, inquire how many pieces of data

The method can be processed according to different situations query with these three attributes;

Guess you like

Origin blog.csdn.net/tianxiu11/article/details/88959030