LINQ to SharePoint - Announcing the 0.2 alpha release

Hi folks,

It's a lovely day, especially for the LINQ to SharePoint project ( The last set of features that were planned for the 0.2 release have been implemented finally and code has been checked in to the CodePlex source control. So, I'm extremely proud to announce the 0.2 alpha release is coming closer day after day. This version targets the Orcas Beta 1 release and WSS 3.0 (although it should work fine with older versions of SharePoint too, but notice these versions didn't get the desired amount of testing yet).


Key improvements have been made on the level of the query parser and the SpMetal tool. Here's a quick overview of the core features covered in 0.2:

  • Enhanced support for SharePoint list field types, including Lookup and LookupMulti fields with lazy loading support and subquery support, e.g.

    from user in users where user.IsMember select new { user.Name, user.Profile }; // user.Profile will be loaded lazily when a property is accessed
    from user in users where user.Profile.Age >= 24 select user; // a subquery will be created for the user.Profile.Age >= 24 part


  • Changes to the entity model used by LINQ to SharePoint, in preparation for update support down the road, e.g.

    class User
       [Field("First Name", FieldType.Text]
       public string FirstName
          get return (string)GetValue("FirstName"); } // GetValue is defined on the SharePointListEntity base class
          set SetValue("FirstName", value); } // SetValue is defined on the SharePointListEntity base class

  • Optimization of the CAML queries generated by the query parser, e.g.

    from e in src where 1 == 1 && e.Age >= 24 select e; // (true && e.Age >= 24) == (e.Age >= 24) - similar optimizations are in place for other boolean operators
  • Support for First and FirstOrDefault query operators, e.g.

    (from e in src select e).First(); // equals to .Take(1)
  • Introduction of a CamlMethods static class with helper functions, including DateRangeOverlaps, e.g.

    from task in tasks where CamlMethods.DateRangeOverlaps(DateTime.Now, task.DueDate) select task; // generates a <DateRangeOverlaps> CAML element



  • Support for Now and Today elements, e.g.

    from task in tasks where task.DueDate >= DateTime.Today select task; // generates a <Today> CAML element; similar treatment for DateTime.Now
  • Multiple Where clauses per query are supported, e.g.

    from user in users where user.IsMember orderby user.Age descending where user.Age >= 24 select user; // constructs an <And> combination of individual where predicates
  • SpMetal improvements and separation of front-end and back-end functionality, allowing for hosting of SpMetal functionality in other environments (such as an IDE);
  • Availability of the first draft of the technical spec;
  • First set of unit tests covering the query parser;
  • Lots of bug fixes.

I'm also happy to tell that planning for the 0.3 release has started today. 0.3 will likely be the first beta release of the project, covering overall improvements to the query parser and the addition of entity update support through SharePointDataSource<T>. More exciting features are on the wish-list and hopefully these will make their way to the first beta. Stay tuned and leave your feedback!

In the meantime, make sure to check out the project's home page at The 0.2 release bits will become available later this month but for those of you who can't wait, the most up-to-date sources are available at any time via the Source Code tab :-). The next couple of days, additional testing will be carried out to ensure stability of the 0.2 release.

Btw, other 3rd party LINQ Providers are under development too - check out the OakLeaf Systems blog at for a list of such implementations. | Digg It | Technorati | Blinklist | Furl | reddit | DotNetKicks

Published Monday, July 02, 2007 1:00 AM by bart
Filed under:


No Comments
Powered by Community Server (Non-Commercial Edition), by Telligent Systems