Sunday, April 22, 2007 4:43 PM bart

LINQ to SharePoint - 0.1.2.0 Alpha release available now

It's been a long ten days since the first announcement of the LINQ to SharePoint project, with lots of implementation and testing work but tonight I'm very excited to announce the availability of the first public alpha of the LINQ to SharePoint project. A few highlights of this release:

  • Supports writing LINQ queries for SharePoint lists in both C# 3.0 and Visual Basic 9.0
  • The SpMetal entity type creation tool supports both C# 3.0 and Visual Basic 9.0
  • Talks to SharePoint over web services or though the SharePoint Object Model
  • Most CAML query constructs are available via LINQ

The current alpha release is built for the Orcas March 07 CTP. An update for Orcas Beta 1 will follow later.

 

For more information, visit the following pages:

Warning: This release is an alpha release; use it at your own risk. You shouldn't use the alpha release in any production environment whatsoever.

 

A little sample of a (very simple) LINQ to SharePoint query in C# and VB:

C# 3.0 LINQ-to-SharePoint query
1 var users = new SharePointDataSource<User>(new Uri("http://wss.mycompany.local")); 2 3 var res = from u in users 4 orderby u.Birthdate descending 5 where u.FirstName.StartsWith("B") && u.Age >= 24 && u.FavoriteFood == FavoriteFood.Pizza 6 select new { u.FullName, u.Age, Interest = u.AccountBalance * 0.07 }; 7 8 foreach (var u in res) 9 Console.WriteLine(u); 10

VB 9.0 LINQ-to-SharePoint query
1 Dim users As New SharePointDataSource(Of User)(New Uri("http://wss.mycompany.local")) 2 3 Dim res = From u In users _ 4 Order By u.Birthdate Descending _ 5 Where u.FirstName.StartsWith("B") And u.Age >= 24 And u.FavoriteFood.Value = FavoriteFood.Pizza _ 6 Select u.FullName, u.Age, Interest = u.AccountBalance.Value * 0.07 7 8 For Each u In res 9 Console.WriteLine(u) 10 Next

Much more complicated queries are supported though, allowing you to focus on the query itself rather than on the CAML plumbing. A list of a few complexities that LINQ-to-SharePoint can deal with:

  • Recursive parsing of query trees and translation of boolean negation into normal forms using De Morgan's laws.
  • Analysis of projection operations to create a list of required fields in the query to reduce bandwith.
  • Condition analysis and validation required for translation to supported CAML constructs.
  • Nullable type support language differences between VB and C#.
  • MultiChoice-to-enum mapping and support for fill-in choices.
  • Visual Basic's runtime libraries for string comparisons.

 

Please report any issues with the software via the project website. You feedback is highly appreciated!

Enjoy!

Del.icio.us | Digg It | Technorati | Blinklist | Furl | reddit | DotNetKicks

Filed under: , , ,

Comments

# re: LINQ to SharePoint - 0.1.2.0 Alpha release available now

Tuesday, April 24, 2007 2:58 AM by Emile

Bart,

I've build an LINQ to WMI provider a long time ago in 2005 (http://bloggingabout.net/blogs/emile/archive/2005/12/12/10514.aspx) it still has good code and  if possible i would like to join your project to aid in developing the LINQ to SP library.

Regards,

Emile (mielzpost@gmail.com)

# Community Convergence XXVI

Sunday, May 06, 2007 6:42 PM by Charlie Calvert's Community Blog

The biggest news in the C# community is the official announcement of Silverlight at the MIX conference.

# Community Convergence XXVII

Sunday, May 13, 2007 11:13 PM by Charlie Calvert's Community Blog

Welcome to the 27th Community Convergence. I use this column to keep you informed of events in the C#

# Community Convergence XXVII

Sunday, May 13, 2007 11:19 PM by Charlie Calvert's Community Blog

Welcome to the 27th Community Convergence. I use this column to keep you informed of events in the C#

# Jacqueline van der Holst &raquo; LINQ to Sharepoint

Monday, May 28, 2007 2:52 PM by Jacqueline van der Holst » LINQ to Sharepoint

Pingback from  Jacqueline van der Holst &raquo; LINQ to Sharepoint

# TerraServer Sample: A LINQ Provider

Sunday, January 06, 2008 5:34 PM by Charlie Calvert's Community Blog

Over the holidays Alex Turner, Mary Deyo and I added a new sample to the downloadable version of the

# TerraServer Sample: A LINQ Provider

Sunday, January 06, 2008 6:33 PM by Noticias externas

Over the holidays Alex Turner, Mary Deyo and I added a new sample to the downloadable version of the

# MSDN Blog Postings &raquo; TerraServer Sample: A LINQ Provider

Sunday, January 06, 2008 6:47 PM by MSDN Blog Postings » TerraServer Sample: A LINQ Provider

Pingback from  MSDN Blog Postings  &raquo; TerraServer Sample: A LINQ Provider

# TerraServer Sample: A LINQ Provider

Monday, January 28, 2008 9:15 PM by Dan on eScience & Technical Computing @ Microsoft

Ran across this post on Charlie Calvert's Community Blog using TerraServer's Web Services with LINQ...why

# Learning LINQ - No excuses

Thursday, March 13, 2008 6:59 AM by Shawn Cicoria - CedarLogic

There are really a whole bunch of great resources out there that help the community get up &amp; running

# Learning LINQ - No excuses

Thursday, March 13, 2008 7:03 AM by Shawn Cicoria

There are really a whole bunch of great resources out there that help the community get up &amp; running

# Learning LINQ - No excuses

Thursday, March 13, 2008 7:28 AM by Noticias externas

There are really a whole bunch of great resources out there that help the community get up &amp; running