Asp.net MVC Output Caching During Development

During some asp.Net MVC development for a public website recently I have been looking at caching. The content of the site has minimal churn so I looked to use OutputCache. This works fine once it’s been finished and released. However it causes frustrations during development when you want to change something, compile, refresh and nothing happens. One option is to comment out the OutputCache attribute, either on each action or on the specific controller, during development but that seems a bit crazy and isn’t sustainable....

December 13, 2014 · 1 min

Microsoft Arc Touch Bluetooth mouse and Surface Pro 2 not working

I purchased a Microsoft Arc Bluetooth mouse to use with my Surface Pro 2 and after it arrived it connected with the Bluetooth straight away and worked fine however there was an annoying sound on the scroll wheel which had to go. After a search it was recommended to download the Microsoft Keyboard and Mouse centre to configure the mouse. I downloaded the appropriate installation and was promptly told mouse could not be recognised....

December 13, 2014 · 1 min

Enums in C#; Doing More Than You Thought!

I have been developing for a while now and use Enums on a daily basis (nearly) and was quite happy in my understanding an Enum definition had a set number of values and of those values they could be cast to the related integer value (or another under-lying type) and back again. And then I saw the following piece of code (condensed down for example): System.Net.HttpStatusCode value = (System.Net.HttpStatusCode)429; var result = (429 == (int)value); There is no corresponding value in System....

July 22, 2014 · 2 min

Feeling overwhelmed and like a phony Chill out!

Do you ever feel overwhelmed by the amount of new technology which is coming out all the time? The new framework to do this, and the new improved way of doing that. The new blog posts about this and that, the never ending Pluralsight courses by John Sonmez? It can be too much! Recently I’ve been feeling this way as well as losing the motivation I use to have to code....

August 29, 2013 · 4 min

Make your code readable by making it flow with Generics

I’ve seen a couple of examples of code recently which basically have a method which work primarily on a base class but the resultant will always be cast to a concrete implementation. This can make the code a bit clunky as each caller has to cast the resultant to the type it’s expecting. Let me show you want I mean: public abstract class Base { public string Comment { get; set; } } public class Concrete : Base { } public class Update { public static Base AddComment(string message) { // the type created can be determined by some other means eg db call etc....

July 18, 2013 · 2 min