Farseer.net Lightweight Open Source Framework introductory article: The ultimate use of where conditions

Source: Internet
Author: User

Navigation

Catalog: Farseer.net Lightweight Open source Framework Catalog

Previous: Farseer.net lightweight Open Source Framework introductory article: query data in detail

Next: Farseer.net Lightweight Open source Framework intermediate: The use of transactions

Here, I put some common where use of the conditions are written here, for everyone to learn

 1  //  2  Users.Data.Where (o = = O.id = 1  )  3  Users.Data.Where (o = o.id > Span style= "color: #800080;" >1  )  4  Users.Data.Where (o = O. ID < 1  )  5  Users.Data.Where (o = o.id >= 1 ) 
1 // Bulk contains data elements: 1, 2, 3, 4, 5  SQL-like in operations 2varnew list<int1  2345  }; 3 Users.Data.Where (o = lst. Contains (o.id))
1 // fuzzy search similar to SQL like  %...%2 Users.Data.Where (o = o.username.contains (keywords));
1 // and of course it supports multiple conditions . 2 1 " Zhang San " 1)  )
1 //Fuzzy search + Advanced Search2varKeywords ="";3varBean = Users.data;//can also be: var bean = User.Data.Select (o = = new {o.username, o.password})4Bean. Where (o = o.id >1);5if(keywords. Ishaving ()) {bean. Where (o = o.username.contains (keywords)); }//Fuzzy Search When keywords has value6//actions that can be added to or7Bean. Whereor (o = O.roleid = =2);8varLST = Bean. ToList ();
1 // similar to: Like ' Zhang% with Zhang Kaitou 2 Users.Data.Where (o = O.username.startswith (" Zhang "));
// similar to: like '% three ending with three Users.Data.Where (o = O.username.endswith (" three "));
1 // Ignore case when query in Oracle is case-insensitive by default 2 Users.Data.Where (o = o.username.isequals (" Zhang San "));
1 // the length of the queried user name is greater than 2 bits 2 2);
1 // Query time difference:  2014-11-06  to 2014-11-06 data 2new DateTime (all, 6 ); 3 Users.Data.Where (o = o.createat >= dt && o.createat < dt. AddDays (1));

Navigation

Catalog: Farseer.net Lightweight Open source Framework Catalog

Previous: Farseer.net lightweight Open Source Framework introductory article: query data in detail

Next: Farseer.net Lightweight Open source Framework intermediate: The use of transactions

Advertising time

QQ Group:116228666 (farseer.net Open source frame exchange) Please specify: Blog Park

Farseer.net is an ORM framework + Common tool + extension collection.

Farseer: Prophets and seers usually offer tricks and strategies in certain situations. Also hope that the framework can provide you with maximum convenience.

ORM: The English name is:object relational(relationship) Mapping(map)

Farseer.net's goal is: Quick start, rapid development, simple and convenient.

1 New 1 " Zhang San " }. Insert ()

Farseer.net Lightweight Open Source Framework introductory article: The ultimate use of where conditions

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.