C# Parallel Invoke

While working through some code, I noticed a method that I have never seen before. I knew that the .Net 4 Framework had introduced a Parallel Class that helped make parallel ForEach Loops easier, but after some searching I came across the ParallelInvoke() method. So, I jumped on the MSDN…

Explicit Interface Usage in C#

Where possible, I try and program against interfaces as much as possible. I do this because I like Interface-based programming and because I like the characteristics that it brings to the table: reusability, maintainability, and extensibility. It also allows you to effectively test your code using Mocks. Whether or not…

A Simple Guide to using OAuth with C#

If you are a newbie to OAuth you might understand how confusing it can be at first! I started off looking at building a small application that consumed an OAuth service as a side project. I kinda just dived right in without understanding how OAuth worked and got myself very…

Basic Introduction To Writing Unit Tests With MOQ

What is mocking? Well....according to Wikipedia it is: "In object-oriented programming, mock objects are simulated objects that mimic the behavior of real objects in controlled ways. A computer programmer typically creates a mock object to test the behavior of some other object" In short,¬†Mock objects¬†are…

Useful Lambda Expressions

A really useful built in feature of .Net is the Lambda expression. I've been using these for a while, but until I started looking into it, I never realized how useful these can actually be. There are loads of quick, nifty ways to get things done that might take twice…

Rendering a Usercontrol as a String for Webservices

I am currently working a project at work that requires us to use progressive enhancement so that our site is accessible to all users regardless of whether they have javascript enabled. One of the issues that we came across was keeping only one version of the html that we needed…

Vote for your favourite .NET DI (IoC) Framework

I've started to take a look at Dependency Injection Containers (IoC), mostly because we have started using them where I work and also just out of general interest and trying to get my mind around how they work. From Wikipedia: Inversion of control, or IoC, is an abstract principle describing…

MVC HtmlHelper for Google Charts

Asp.net Mvc has an awesome little class called the HtmlHelper class. I have only recently started to get into creating custom HtmlHelpers, and I thought that creating a small Google charting helper would be a good place to start. From the Microsoft MSDN site: The HtmlHelper class provides a…

Developing Applications for Windows 7

I've just got my hands on a shiny new computer, maxed out with new RAM and Windows 7. So far I am very impressed with Windows 7, although it looks pretty similar to Vista, its a lot slicker and I can't really seem to find any faults just yet. I…

Create Barcodes and Pdf's in C# with iTextSharp

An easy way to create PDF files is to use iTextSharp. It is an opensource PDF library that allows to you generate PDF files on the fly. It's great if you need to dynamically create a PDF using dynamic data. Also, I found that this is a great tool to…