Archive for October 2015

Advanced IP address filtering in MVC and WebApi
Restrict or allow specific IP addresses to access your WebApi or MVC
Last year I wrote an article about IP address filtering on MVC and WebApi Restrict Access to an MVC Action or Controller based on IP address. Over time the requirements for IP filtering in several web based application increased, so I had t work on this class to make it more extendible and reusable in different scenarios. The new scenarios I wanted to cover are: ... read more
.NET managed scheduled task runner
Scheduled managed code execution in .NET
Sometime ago I wrote an article about Windows Scheduled Task vs Windows Service where I compared and listed benefits and drawbacks of using scheduled tasks in Windows and Windows Services for executing certain operation which repeats in some time span. However idea of executing tasks in a single Windows Service is very useful if you need to execute task in a short time span plus you have a full control including logging and other fine grained customization in case you write the task in your code... read more
Reduce the number of request from the page by using base64 in CSS
Embedding images in CSS as base64 strings
One of the major things that affects your page performance is the number of requests made from your page. Any external resource included on the page page makes your page loads slower. Most commonly these are images... read more
MSMQ JSON message formatter
Use JSON to serialize and deserialize message queue messages
Storing objects in the message queue (MSMQ) is based on the serialization of the object instance using some of the serializes, basically any class the implements IMessageFormatter. Most commonly used ones are BinaryMessageFormatter and XmlMessageFormatter. I prefer XmlMessageFormatter over BinaryMessageFormatter, mostly because messages are stored in a readable format inside the queue, so in case something goes wrong you can direly check the content of the message using built Computer Management MMC (Microsoft management console) in the. ... read more