Sharepoint and Linq

Todd Bleaker is presenting, so this should be a great session.

He's not going to be doing much deep diving, more of an overview of all the possible ways to access data from SharePoint.

Nice diagram of the data technologies showing the different layers, along with their typing and if they are client or server side.

Client Technologies

  • REST API's – Strongly typed, intellisense
  • Client OM – Weakly typed

Server Technologies

  • Server OM – Existing layer weakly type
  • LINQ – New and is strongly typed

Focusing on the Lists and Queries in SharePoint.

He's going to work with three different lists

  • Clients – Have many projects
  • Projects – Have many Timecards
  • Timecards

Very nice feature he's touching on, SharePoint now supports both cascading deletes and restricting deletes.

Validation and Uniqueness are now supported on Lists and Columns.

Automatic large query throttling – They by default only return 5000 items, super-users can retrieve 20,000 items. This is set on a by site basis. Developers can override the settings as well.

He's now doing demos of all the above things.

Very nice, you can now display columns of a list you've created a lookup for in the child list. VERY NICE.

Cascading deletes put not just the original item you're deleting, but also the children records as a unit. When they are restored they all come back as a unit.

Wow, you can now edit the default edit, view pages right from the ribbon, that's going to save some real time and frustration.

Pagination will now apply to what data is retrieved from the database.

Client OM

Unified object model across all clients, javascript, .Net and Silverlight.

Again it's a subset of the Server OM.

The requests to the server are all batched together before they are sent to the server in one request.

He used the Yahoo tree view, because it's totally on the client side.

Reference for REST API's

Javascript client om limitations. Can only work on the server relative url it is in.

Nice setting in Internet options that lets you turn off the FEED view for RSS feeds.

LINQ To SharePoint

  • Entity based programming on the server
  • Translates LINQ queries into CAML Queries
  • Can be used in
    • Web Parts, Event Receivers, Sandboxed code

Use SPMetal to create proxies, or create it in the IDE.

Lots of code examples, I like J

Todd has so much energy, it always makes the presentations exciting.

There's a great slide at the end describing the best time to use each of the different object models and the data access methods.