This post describes how I use a custom
RouteNames class together with
UrlHelper.RouteUrl to generate route URLs in ASP.NET Core MVC.
This post describes how I use a custom
The regular expression pattern
\d matches more than just the ten digits commonly used in programming. Here's a list of matches you might not have expected.
Here's how to inline Angular view templates into the page HTML for better performance using ASP.NET MVC and Razor.
CommonMark.NET is a Markdown parser for .NET that efficiently transforms Markdown written in CommonMark dialect into HTML.
Here's a compilation of my favorite session recordings from Build 2015. They're all about ASP.NET 5, C# 6, and TypeScript.
Read my thoughts on Microsoft's big announcement of open-sourcing .NET and officially supporting true cross-platform development on Windows, Linux, and Mac.
The IndentedTextWriter class allows you to output hierarchically structured data while preserving the nesting through indentation. Here's how.
Learn how you can manually bootstrap AngularJS applications and initialize them with asynchronously loaded JSON data.
By designing your code for functional composition, you can keep it simple and targeted, making it easier to implement, understand, and test it. More sophisticated logic can be modeled by composing various building blocks of basic functionality — extension methods for collections, in the case of this post.
ResX files allow you to easily localize an ASP.NET application. I'll show you how I manage resource strings containing placeholders with confidence at compile-time.
ReSharper offers a vast suite of refactoring methods, all of which have their own shortcut. Here's a list of 8 shortcuts I've found to be indispensable.
C# defines plenty of modifiers for type and type member declarations, some of which can be combined. Learn about how "protected internal" and "override sealed" work.
In C#, every variable of a reference type can hold a null value. Some types like collections and delegates, however, allow for much better default values. Reduce your bug surface area by following reasonable conventions when dealing with null.
The collection initializer syntax of C# is a clean way to initialize a collection with values. The compiler will insert appropriate method calls which actually add those items. We can leverage the convention-based nature of this process to provide our custom collection initializers.
When you're resizing images in .NET, you might get artifacts along the edges of the resized image, which are called ghost borders. Here's how you get rid of them.
Read about a little exception helper class I've written which encapsulates parameter null checking and other validation functionality. By providing a concise and easily readable interface, it helps shorten and declutter your methods.
The behavior of the .NET regular expression engine can be configured in a variety of ways. Here's a detailed look at all the different regex options.
Many AngularJS applications require initial data on startup. Here's how you can pass server-side C# data from ASP.NET to HTML.
The Enumerable class contains some lesser-known static members. Here's an overview over the Empty, Range, and Repeat methods.
If you want to use integers rather than strings for document IDs in RavenDB, you need a little hack in order to get indexes working correctly. Here's what you have to do.
The Newtonsoft.Json library allows you to conditionally serialize object properties by looking for a method following a certain naming convention. Here's how that works.
The FluentSecurity library can resolve its policy violation handlers through a dependency injector such as Ninject, as this example shows.
Pluralsight offers a great course on building ASP.NET MVC applications using EntityFramework and a bunch of modern front-end technologies, such as HTML5, Modernizr, and jQuery.
Let's take a look at how we can use the FluentSecurity library to secure ASP.NET MVC applications in a centralized place.
I've created a NuGet package for my ExtraLINQ project. Go grab it!
When I used the Enumerable.Except extension method, its behavior startled me. It creates a set difference, which might not be what you expected. We'll take a look at how Enumerable.Except is implemented in the .NET Framework.
I've written a library called ExtraLINQ, which provides additional extension methods for working with .NET collections.