Dot Net Solutions
George V Place,
4 Thames Avenue
Windsor
Berkshire
SL4 1QP
Great Britain
0845 402 1752
GEO: -0.606174, 51.4843
 
 
 
 
11 Jun 2010

Functional Alchemy: Making Silverlight synchronous

Caught this article on the Morning Brew today, on making web service calls in Silverlight synchronous (which is fine as long as they're not running on the UI thread). Had a quick look through the code, including the CodeProject article which provided the base, and thought it seemed a little complicated. I've recently discovered that you can use the Reactive Framework extensions to wrap the event-based async pattern and make it synchronous; so far, I've just used it for unit testing, but I thou ... [Read more]
Published: 11 Jun 2010  11:44 | 1  Comment | 0  Links to this post
 
 
 
 
18 Mar 2010

Azure Table Service REST API, part 1: headers & authentication

One of the nice things about Microsoft Windows Azure services is that they have a very well-defined and consistent REST API, meaning that they can be accessed from any language which can formulate an HTTP request; pretty much any language you can realistically expect to build an application in today. So as well as accessing the storage services from .NET/Silverlight CLR (or DLR) languages via the official SDK, you can access them from Rich Internet Applications written in HTML5 and Javascript, ... [Read more]
Published: 18 Mar 2010  03:58 | 0  Comments | 0  Links to this post
 
 
 
 
11 Mar 2010

RDBMS vs NoSQL

(Yes, again.) There's an awful lot of buzz around new-fangled "NoSQL" or "non-relational" databases at the moment. I'm hearing a lot of people asking why they'd choose one of these new-fangled storage models over the relational databases they know and (mostly) like. This post aims to shed some light on the choices available, and to maybe give some guidance if you're trying to make a decision. Let's define some terms I find it always helps to make sure you're talking a ... [Read more]
Published: 11 Mar 2010  03:56 | 3  Comments | 0  Links to this post
 
 
 
 
09 Mar 2010

XmlElementAsDictionary: A very simple wrapper for LINQ to XML

Why? I've been forced into engaging with XML in all its gory details recently, as part of my AzureKit project (more on which in another post). Being a big fan of all things LINQ, I started out trying to use the LINQ-to-XML framework. I had problems. This is not a fault of the framework; as a fundamental part of the .NET Framework it must provide a way to achieve everything, and that's not the same as providing a way to do things simply. The REST API for Windows Azure uses a hybrid of t ... [Read more]
Published: 09 Mar 2010  04:00 | 0  Comments | 0  Links to this post
 
 
 
 
05 Mar 2010

Reactive Extensions (Rx) and MVVM

Overview Reactive Extensions (Rx) is the hot new toy out of Microsoft's DevLabs, which is included in Silverlight 4 and .NET 4, and is available as a download for Silverlight 3 and .NET 3.5. It provides a new LINQish way of managing and handling events. More information and downloads available at the DevLabs project page. I'd read quite a bit about Rx but hadn't taken the time to have a play with it until today, when I found myself looking at the code for a Model-View-ViewModel messaging im ... [Read more]
Published: 05 Mar 2010  03:57 | 3  Comments | 0  Links to this post
 
 
 
 
25 Feb 2010

Tuple.Do

Another example of using extension methods to improve the readability of your code. Version 4 of the .NET Framework introduces a new Tuple type; or rather, a set of Tuple types with different numbers of generic parameters. Tuples represent an ordered set of values, and are first-class features in some languages, particularly functional ones such as F#, which can return multiple values from a function, as in this example (which requires the PowerPack DLL): let success, value = TryParse ... [Read more]
Published: 25 Feb 2010  10:57 | 0  Comments | 0  Links to this post
 
 
 
 
17 Feb 2010

Working with namespaces in LINQ to XML

I was working on an Azure utility with Johan on Friday, which had to deal with the XML responses provided by the Service Management REST API. XML like this: <HostedServices xmlns="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> <HostedService> <Url>https://management.core.windows.net/GUID/services/hostedservices/foo</Url> <ServiceName>foo</ServiceName> </HostedService></Host ... [Read more]
Published: 17 Feb 2010  09:11 | 1  Comment | 0  Links to this post
 
 
 
 
21 Jan 2010

Quick: ReadOnlyDictionary

I've seen a few posts on other blogs commenting on the lack of a ReadOnlyDictionary in the .NET framework, often with implementations which wrap a regular Dictionary and prevent modification. I thought I'd point out a solution to this problem which is provided in the Base Class Library: IEnumerable<KeyValuePair<TKey, TValue>> That's it. And it's what's returned if you call dictionary.AsEnumerable(). The consumer of your class can convert it back into a Dictionary by passing it int ... [Read more]
Published: 21 Jan 2010  03:09 | 0  Comments | 0  Links to this post
 
 
 
 
19 Jan 2010

My .NET Framework – Part 2: Properties

This is the second in a series of posts on useful extensions to the .NET Framework. Part one is here. Basic and Automatic Properties In the first two major releases of the C# language, properties were implemented as a (usually private) field with a hand-coded property which regulated access to the value of that field, like so: class Foo{ private string _name; public string Name { get { return _name; } set { _name = value; } } } At build time, the ... [Read more]
Published: 19 Jan 2010  03:09 | 0  Comments | 0  Links to this post
 
 
 
 
15 Jan 2010

My .NET Framework – Intro & Part 1

Intro I’ve just started here at Dot Net Solutions after eight years at my last job. That means that nearly all my experience with .NET and Visual Studio 20xx happened at that one place, and over that time I built up quite a collection of “accessories”. Some of those were tools, utilities and plug-ins which I’m gradually tracking down and re-installing each time I reflexively go to do something and it’s not there or it doesn’t work: for instance, it turns out that “Edit with Vim” is not a stand ... [Read more]
Published: 15 Jan 2010  02:56 | 0  Comments | 0  Links to this post