The project I'm currently working on involves numerous REST APIs from a multitude of very different services. In my initial prototype, which I've since scrapped, I went with trying to use a local wrapper for each REST API incorporated into my project, meaning I used the GData library for handling YouTube, FlickrNET for Flickr, etc...
As you can imagine, having N libraries for N different REST APIs in my service snowballed into a maintainability nightmare. In my new redesign I decided to use a generic REST wrapper in .NET, and as it so happens there are two full API-agnostic REST libraries in .NET: HammockREST and RestSharp. If there's one thing you can fault both of these libraries for, it's lack of documentation - they're both new comers to the .NET open source community, so I'm going to contribute some documentation for Hammock and RestSharp, starting with...
All user input is evil, and you know it. Since the inception of .NET, ASP.NET developers have had access to the ASP.NET Validators Control Library, which made the previously tedious process of validating form input simple and in many instances, trivial. Microsoft's Enterprise Library makes this familiar ASP.NET functionality available at the object level in your applications via the Validation Application Block, which I've been using throughout some of my new projects.
It can take a while to get familiar with the Validation Application Block, so my goal here is to show you how to quickly get started with it using attribute-based validation, which in my opinion is the simplest way to implement validation. By the time you're doing reading this you'll know how to use built-in validators such as the RangeValidator, RegexValidator, DateTimeRangeValidator, and so forth.
Introduction to the Validation Application Block Built-in Validators
I write a lot of parse-heavy applications, so naturally I spend a fair amount of my development time writing and testing regular expressions. Regular expressions are one of those programming constructs where you always have a clear idea of what you need to do but you work with them just infrequently enough that you can never actually remember the exact syntax. And if you're like me, this means a multi-hour regex 101 refresher until you get it right.
Rather than testing my regular expressions in the middle of a unit test or in some temporary debug code, I've started using .NET Framework Regular Expressions Demo (scroll down to the bottom) provided by Regular-Expressions.info. It's a simple Windows Forms application that allows you to run quick regex tests using the System.Text.RegularExpressions engine, which is nice because it's actual regular expressions engine you'll be using in your .NET production code.
Let me show you how it works using a couple...
One of my favorite WordPress plugins dating all the way back to when I first started blogging is Subscribe-Remind (WordPress) - it simply appends a small RSS subscription reminder to the footer of every blog entry for your readers! The reminder reads something like this:
If you enjoyed this post, make sure you subscribe to my RSS feed!
Simple enough, right? I've made a port of this popular WordPress plugin for BlogEngine.NET, SubscribeRemind, which does exactly the same thing as its WordPress counter part. It appends a small subscription reminder at the footer of every blog post using the RSS feed specified through the BlogEngine.NET settings.
If you're using an alternate RSS address (i.e. FeedBurner), the extension will automatically use that one as the target - it uses whatever RSS feed target you've specified in your BlogEngine.NET settings.
I've found that adding an RSS susbscription reminder at the footer of...
I added a page a list of the .NET client libraries I use in my production and development code. Some of these, like NUnit and NLog, are pretty well-known to grizzled .NET developers, but others like the HTML Agility Pack and Hammock are not nearly as well-known as they should be given how powerful and extensive they are.
Check out my list of .NET client libraries and let me know if you have any suggestions.
After a couple of happy years blogging my forays into social media, Facebook application development, online marketing, and so forth on AjaxNinja / Marketing Ninja, I took a year-long break from blogging between May, 2009 and May, 2010. Now that I'm back in the saddle with my copy of Visual Studio, a slew of startup ideas in the social media / online marketing space, and a hell of a lot of energy, I decided that it was time to get back into the habit of blogging.
As of writing this I'm still working for SmartDraw as a mutli-faceted online marketer, although I'd like to see one of my startup projects take a life of its own and blossom into what I do full time.
Here are the goals I have for this blog:
- To publish short code samples which other .NET programmers may find useful in the course of developing their own...