Linq

Linq
Combining LINQ to SharePoint and LINQ to Objects

Although the join syntax in LINQ to SharePoint is very powerful, sometimes there are situations where you won’t be able to retrieve the data that you need using this syntax. Sometimes there may be operations that you require that are not permitted on the LINQ to SharePoint provider since they are considered inefficient. Performing an in memory sub-query As an example, let’s imagine that our sample application requires a list of asset tags and locations codes for a particular contract, but only where the locations are also being used to store assets that are subject to another contract....

posted @ Tuesday, March 16, 2010 12:08 PM | Feedback (0)

Joins in LINQ to SharePoint 2010

You may have noticed above that the Join extension method is not permitted within LINQ to SharePoint. However, this does not mean that retrieving related data isn’t possible, only that arbitrary joins are not supported. Where the relationship between two entities is defined by a lookup column, retrieving related data is permitted and in fact is actually achieved using a much simpler syntax than is required by the Join operator. Simple join private void button8_Click(object sender, EventArgs e) { using(SampleDataContext dxRead = new SampleDataContext(SiteUrl.Text)) { StringBuilder...

posted @ Friday, March 12, 2010 9:19 PM | Feedback (0)

Extending Linq to SharePoint

I’ve been doing a lot of work with Linq to SharePoint over the past month, creating content for my new SharePoint 2010 development book. You know it’s a strange thing writing a technical  book, when you first start out you wonder how you’ll fill the pages. As you get into it though you very quickly find that there’s a lot more stuff you’d like to add but don’t have the space. I like to take things to bits completely before I start wiring about them. It’s always good to know where the limits are before you think about scenarios...

posted @ Saturday, January 23, 2010 6:52 PM | Feedback (2)