Aaron Powell's blog

var blogs = umb.Posts.Where(p => p.Intelligent);

A Developers Guide to LINQ to Umbraco - Session 1 - Getting Started

Saturday, 24 October 2009 by Aaron Powell

Update: This video is now avaiable on Vimeo.

This post is part of a series, for all the posts in the series see the following table of contents:

  • Session 0 - Overview
  • Session 1 - Getting Started
  • Session 2 - Working with LINQ to Umbraco Entities
  • Session 3 - Delving into the UmbracoDataContext
  • Session 4 - Performance and Caching
  • Session 5 - Paging and control-less forms
  • Session 6 - Outputting XML
Getting Started
In this session I'll be looking at the basics of what is required for LINQ to Umbraco.
We'll look at how to generate the classes and some suggestions on how to get the best generated class names.
Runtime - 06:43
Download - FLV (14mb), MOV (24mb)

A Developers Guide to LINQ to Umbraco - Session 2 - Working with LINQ to Umbraco Entities

Saturday, 24 October 2009 by Aaron Powell

Update: This video is now available on Vimeo.

This post is part of a series, for all the posts in the series see the following table of contents:

  • Session 0 - Overview
  • Session 1 - Getting Started
  • Session 2 - Working with LINQ to Umbraco Entities
  • Session 3 - Delving into the UmbracoDataContext
  • Session 4 - Performance and Caching
  • Session 5 - Paging and control-less forms
  • Session 6 - Outputting XML
Working with LINQ to Umbraco Entities
In this session I'll be looking at the code which was generated from the first session and how we can do some basic interactions. We'll also create our first control using LINQ to Umbraco.
Runtime - 18:54
DownloadFLV (37mb),  MOV (92mb)

A Developers Guide to LINQ to Umbraco - Session 3 - Delving into the UmbracoDataContext

Saturday, 24 October 2009 by Aaron Powell

Update: This video is now avaiable on Vimeo.

'This post is part of a series, for all the posts in the series see the following table of contents:

Delving into the UmbracoDataContext
In this session I'll be looking at the heart of LINQ to Umbraco, the UmbracoDataContext. We'll look at what it's role is, and how it can be used in extensibility.
Runtime - 16:08
DownloadFLV (32mb),  MOV (235mb)

A Developers Guide to LINQ to Umbraco - Session 4 - Performance and Caching

Saturday, 24 October 2009 by Aaron Powell

Update: This video is now available on Vimeo.

This post is part of a series, for all the posts in the series see the following table of contents:

Performance and Caching
In this session I'll be looking at how to make the most of the built-in caching of LINQ to Umbraco, ensuring your performance is the best.
Runtime - 16:39
DownloadFLV (23mb),  MOV (114mb)

A Developers Guide to LINQ to Umbraco - Session 5 - Paging and control-less forms

Saturday, 24 October 2009 by Aaron Powell

Update: This video is now available on Vimeo

This post is part of a series, for all the posts in the series see the following table of contents:

Paging and control-less forms
In this session I'll be looking at how easy it is to do paging with LINQ to Umbraco entities. Also with MVC being such a hot topic I'll show you how you can make a form which renders LINQ to Umbraco with no ASP.NET server controls.
Runtime - 15:16
DownloadFLV (23mb),  MOV (117mb)

A Developers Guide to LINQ to Umbraco - Session 6 - Outputting XML

Saturday, 24 October 2009 by Aaron Powell

Update: This video is now available on Vimeo

This post is part of a series, for all the posts in the series see the following table of contents:

Outputting XML
In this session I'll be looking at how you can transform the LINQ to Umbraco entities and generate an XML response, for something such as a RSS feed.
Runtime - 12:36
DownloadFLV (10mb),   MOV (76mb)

LINQ to Umbraco videos on Vimeo

Wednesday, 3 March 2010 by Aaron Powell

Well after a lot of complaining from people about the speed of streaming the LINQ to Umbraco videos I've decided to upload them to Vimeo (although personally I didn't have a problem streaming them, it's just those weirdos who live on the other side of the world).

In order they are:

Session 1 - Getting Started

Session 2 - Working with LINQ to Umbraco Entities

Session 3 - Delving into the UmbracoDataContext

Session 4 - Performance and Caching

Session 5 - Paging and control-less forms

Session 6 - Outputting XML

AUSPAC Webinar recording

Sunday, 7 February 2010 by Aaron Powell

Update: The video is now available on Vimeo - http://vimeo.com/9438884

 

In the AUSPAC webinar I ran 2 weeks back I said I recorded (most of the) session (the slide deck can be found here).

Well after 2 weeks of reinstalling my laptop (that took longer than it should have!), my flatmate moving out (and a level of disorganization caused by that) and good ol' procrastination I've managed to get a few spare hours which I could use to encode the video.

It's missing the last ~20 minutes, basically everything after I finished with OS X, but otherwise the session has everything included.
I'm yet to have the additional time to record the missing session, but I figured that getting what I've got so far available was more important.

So if you missed the session, or just loved it that much, grab a copy now! (It's about 45 minutes long and 170mb).

The answer to why this code works

Saturday, 23 January 2010 by Aaron Powell

So at the start of this week I put up a blog asking Why this code works, and to be honest I've grown quite a bit of an ego since then as no-one has been able to answer the question correctly.

One person did get close, but close doesn't quite cut it ;).

Well the answer is actually very simple, and it's a really handy feature of the C# language, explicit operators.
Explicit operators allow you to define explicit casting between types. So the code that was missing from my original post was this:

public static explicit operator UmbracoPage(XElement x) {
    return new UmbracoPage(x);
}

What I've done here is defined how the compiler is to treat a casting of an XElement to an instance of UmbracoPage, and since UmbracoPage inherits IUmbracoPage there is already a defined casting to it.

Inside the body of my explicit operator I can do anything I desire, here I'm just returning a new instance, passing the XElement to the constructor.

I find it really quite elegant, and that it reduces code smell quite nicely.

But explicit operators also have a buddy, in the form of implicit operators (which was the close-but-no-cigar answer). These work by the type being defined by the assignment target, eg:

UmbracoPage page = xElement;

I'm personally not a fan of implicit operators though, I find them less obvious when you're reading code.

So there you have it, a slightly obscure language feature to play with!

Umbraco AUSPAC January post-session stuff

Wednesday, 20 January 2010 by Aaron Powell

First off I'd like to say thanks to all who attended tonights Umbraco webinar, I think we had mid 20's for most of the session, really excited by the volume.

Anyone who hasn't already filled out the post-session review please do so, it'll help me make it more awesome next time ;).

As promised, here are the resources from tonights session:

Slide Deck

.NET project

 

For those who are interested I did record tonights session, but it appears that it stopped recording about 20 minutes before the end. I will try and get the last of the session recorded soon and posted up here as well.

Please be patient with that one :).

Comments (1) |  Umbraco Perminate Link
Next >