LINQ, LINQ to SQL, and SiteMaps

One of my ongoing assignments at work is to develop a brand new website for the county, which is badly needed. The current site is an unorganized mess. The code is Classic ASP (VBScript); CSS, JavaScript, images, and all those good resources are everywhere, and the markup is worse than the markup on my first web pages.

The new site is starting from scratch: a new database schema (except for the AS400), complete redesign (I've convinced them that I can actually design! Bwhahahaha. Naw, this is probably the best design I've done), and brand-spanking new code written in C# for the .NET 3.5 runtimes.

I wanted Visual Studio 2008 for a variety of reasons, but I mainly wanted it for LINQ. For those who do not know what LINQ is, it's a set of extensions that allow you to query just about anything: collections, XML (and you can easily create XML with it, too), SQL, anything. I've particularly fallen in love with LINQ to SQL, which allows you to query a database and work with strongly typed result sets. You don't have to mess with Connections, Commands, DataReaders, or anything like that. There's nothing to open, nothing to close, nothing to dispose. You get a collection as a result, and you iterate through its elements. It's wonderful.

Anywho, I'm using the SiteMap feature of ASP.NET 2.0+, which provides me with a hierarchical representation of the website. My current problem is getting the default XmlSiteMapProvider and my custom SqlSiteMapProvider to play well with each other. I can easily reference the SqlSiteMapProvider from the main XmlSiteMapProvider, but getting my SqlSiteMapProvider to load its own XmlSiteMapProviders is proving a bit more work than I originally thought. It's inspired me to begin working on a couple of mini articles:
  • Writing your own SqlSiteMapProvider with LINQ to SQL that uses SqlDependency for caching and updating.
  • How to incorporate a XmlSiteMapProvider into a custom SiteMapProvider.

When I get around to writing these is up in the air. My bundle of joy takes alot of my time (no complaints there), and I still have a few projects I want to get finished. I may push those back in favor of the articles, as there's almost no information on them on the net… at least that I've seen.

4/21/2008 10:31:00 PM | Tags: .NET, ASP.NET, LINQ, XML
© 2008 Jeremy McPeak