Skip to content
sapiens edited this page Feb 7, 2013 · 3 revisions

Some extensions method were added where you can specify a query criteria using typed expressions (see Readme for examples).

A few .Net methods and properties are supported within a criteria.

If a column is string:

  • Substring
  • StartsWith
  • EndsWith
  • ToUpper and ToUpperInvariant
  • ToLower and ToLowerInvariant
  • Length

If a column is DateTime:

  • Year
  • Day

A column can be contained by an IEnumerable. Only Contains method is supported

var list= new []{"a","b"};
db.Get<Post>(p=>list.Contains(p.Title)) // select * from Post where Title in ('a','b')
Clone this wiki locally