Practical Use Cases for the RegexOptions Flags

Working with regular expressions in .NET is centered around the Regex class. Its most important methods are: IsMatch Match Matches Replace Split These methods are defined as both instance and static methods on the Regex class, allowing you to use them in two ways: // Instance method new Regex(@"\d+").IsMatch("12345") // True // Static method Regex. … more →

Bootstrapping AngularJS Applications with Server-Side Data from ASP.NET MVC & Razor

With server-side technologies like ASP.NET Web API and client-side frameworks like AngularJS, single page applications on the .NET web stack have become more enjoyable to write than ever. Because a lot of the application logic has been moved from the back-end to the browser, thus resulting in rich client interfaces, single page apps require a diffe … more →

Little Gems of the Enumerable Class: Empty, Range, and Repeat

If you're doing any non-trivial amount of work with C# and .NET, you'll be familiar with the joy that is LINQ and the set of extension method it provides. While the Select, Where, Any, and more extension methods are generally well known, the Enumerable static class also offers three non-extension methods, namely Empty<T>, Range, and Repeat< … more →

How to Configure a SQL Server Alias for a Named Instance on a Development Machine

There are plenty of tutorials out there that explain how to configure an MS SQL Server alias. However, since none of them worked for me, I wrote this post so I'll be able to look it up in the future. Here's what finally got it working for me. My Use Case In my development team at work, some of our local database instances have different names. more →

Passing .NET Server-Side Data to JavaScript

There are a lot of different ways to pass data from an ASP.NET back end to a JavaScript front end. In this post, I want to highlight a variety of methods and point out their pros and cons. In particular, I'll focus on how to embed data within the HTML document that's being loaded. Method #1: Fetching Data by Making an AJAX Request I would argue tha … more →