Property Copy – http://stackoverflow.com/a/2624847/1515209

using System; using System.Collections.Generic; using System.Linq.Expressions; using System.Reflection; namespace MiscUtil.Reflection { /// <summary> /// Generic class which copies to its target type from a source /// type specified in the Copy method. The types are specified /// separately to take advantage of type inference on generic /// method arguments. /// </summary> public static class PropertyCopy<TTarget> where TTarget : class, new()… Read more →

Commands and Queries are Holistic Abstractions

This post has been updated Click here In this post I will outline an updated perspective on Commands and Queries. If you are unfamiliar with these two patterns then please see these posts here and here for a great introduction. For the remainder of this post I will assume you have fully subscribed to the idea of parameter objects and… Read more →

Method Injection with Simple Injector

In this post I will outline a trick I created while experimenting with the code for my post Managing Commands and Queries. If you are unfamiliar with these two patterns then please see these posts here and here for a great introduction. For the remainder of this post I will assume you have fully subscribed to the idea of parameter… Read more →

Managing Command and Query Parameter Objects

In this post I will outline some of the techniques I employ to manage my Commands and Queries. If you are unfamiliar with these two patterns then please see these posts here and here for a great introduction. For the remainder of this post I will assume you have fully subscribed to the idea of parameter objects and are comfortable… Read more →

Patterns & Abstractions

Patterns and Abstractions My central architectural pattern of choice is CQRS. Commands Actions that change something and return nothing public interface ICommandHandler<TCommand> where TCommand : ICommand { void Run(TCommand command); } Queries Actions that return something and change nothing public interface IQuery<TResult> { } public interface IQueryHandler<TQuery, TResult> where TQuery : IQuery<TResult> { TResult Execute(TQuery query); } Mediators A combination… Read more →

Debug IIS/global.asax within Visual Studio

Taken from this SO answer You may create a post-build event which changes the timestamp of a web.config file. I used a touch.exe tool from http://www.stevemiller.net/apps/. You also need to set the “Run the post-build event” to Always. With this option set anytime you start the debugger, web.config timestamp is getting updated causing application (thus IIS pool) restart on the… Read more →

A web based Markdown file viewer (IIS/PHP)

Firstly, thanks must go to the author of this post. Put markdown.php in your blog site folder. Add a posts folder and place all your md files into it. Create a content folder and download google prettify and bootstrap Create index.php <html> <head> <link href=’content/bootstrap.css’ type=’text/css’ rel=’stylesheet’ /> <style> * { font-family: Verdana; } </style> </head> <body> <div class=”container”> <div… Read more →