Things to consider – Sitecore and LINQ

The Linq to Items layer does not implement all of IQueryable. Below are list of supported and not supported LINQ items.

  • Supported:
     All
     Any
     Between — with an extra overload for including or excluding the start and end ranges.
     Boost — makes this part of the query more important than the other parts.
     Cast — you can use this instead of Select.
     Contains
     Count
     ElementAt
     EndsWith
     Equal
     Facets — an extension that fetches the facets of predicates.
     First
     FirstOrDefault
     Last
     LastOrDefault
     Min
     Max
     Match — an extension for running regular expression queries.
     OrderBy
     OrderByDescending
     Select
     Single
     SingleOrDefault
     Skip
     Reverse
     Take
     ToList()
     ToLookUp()
     ToDictionary()
     Page — an extension that does Skip and Take automatically for you.
     StartsWith
  • Not supported:
     Join
     GroupBy
     GroupByJoin
     Intersect
     Sum
     Average
     Concat
     TakeWhile
     SkipWhile
     Union

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Powered by WordPress.com.

Up ↑

%d bloggers like this: