Inner Fields and Lazy Initialization in C#

Using lazy initialization in C#, a class’s state is set up such that each property’s get method performs a check to see if the underlying field is null.  If it is, then it calculates or populates the field before returning it.  This is a very simple and common approach, but it requires that the class […]

RazorEngine Performance and Template Caching

I’ve been using RazorEngine on a project and have been impressed with its simplicity and ease-of-use.  However, the performance of the application isn’t quite where I need it to be, and I was pretty sure the issue was with how I was using RazorEngine, especially since I could anecdotally see that the processor consumption on […]

Install Application as Service on Windows Server 2008

Install Application as Service on Windows Server 2008

You can use the sc.exe command to install an EXE as a service on Windows Server 2008.  There’s a good article on creating an application that can easily run as either a console app or as a service here.  From an administrator command prompt, the syntax is something like this: sc servername create MyService.ServiceName binpath= […]

Using If This Then That to Automate Your Life

I’ve just started getting into If This Then That (ifttt.com) and have set up a simple task that will update my Steve Smith Facebook Page whenever I post something here to my blog.  Getting this set up was extremely simple to do, and so far although I’ve only been using it for about an hour […]

Working with Lazy Loading in Entity Framework Code First

Entity Framework 4 has Lazy Loading built-in and enabled by default.  Here’s a quick bit of code to show you how to work with this feature.  To get started with this, simply create a new Console Application and in nuget (Package Manager Console), run this command: install-package EntityFramework.Sample This will install a simple blog post […]