Posts

Using HttpClient to access API resources

Oftentimes we will have the need to call into an API to load resources. HttpClient class provides in the System.Net namespace provides all the required functionality to interact with an API in the usual ways.

Protecting against Cross Site request Forgery (CSRF)

Image
Cross Site Request Forgery, or CSRF as its often known, is a common security vulnerability which describes an attacker attempting to cause state changes on a server by tricking a victim into sending an undesired request from an authenticated session without them knowing. Well thats all great, but what does it actually mean...

ActionResults in ASP.NET MVC 5

In ASP.NET MVC 5  ActionResult  classes are used to return data from the controller classes to the views. There are 15 different sub classes that can be used in various situations depending on your scenario...

Scripting Database Table Create SQL using Powershell

PowerShell is quite high on my list of languages that I dip in and out of without really knowing nearly well enough. One of things that I have found myself doing quite regularly is trying to script SQL for creating tables. This is quite straight forward using Sql Server PowerShell

Setting up log4net in ASP.NET MVC

Image
I seem to burn far to many hours trying to do the relatively simple task of setting up log4net on a project. Well step one is easy enough, install through nuget . Next...

Unit Testing Entity Framework 6 DbContext

The Entity Framework version 6 has good unit testing possibilities and the documentation provided by MSDN provides a good starting point...

A Simple 3 Layer Architecture

Image
A while ago I talked about the standard architectural approach at work . The truth is I'm not completely taken with putting an API in, particularly when its a small application. So how would an application look without the API? Well, I know all of the patterns, but I haven't actually put them together and had a poke around and understood the whys and wherefores of each design decision, so I thought I would give it a try...